[Dlang-internal] Detect CTFE in AssignExp:semantic

Stefan Koch via Dlang-internal dlang-internal at puremagic.com
Wed Jan 11 10:54:46 PST 2017


On Wednesday, 11 January 2017 at 18:51:08 UTC, Andrei 
Alexandrescu wrote:
> On 1/11/17 4:25 PM, Stefan Koch wrote:
>> You should not need to special case ctfe inside the compiler 
>> for this.
>> Rather the template should have if (__ctfe) inside it if those 
>> are needed.
>> However I would advise against splitting code-paths, if it is 
>> not
>> _strictly_ necessary.
>
> That's what confuses me, it's the read of the temporary not the 
> code inside the function. Would branching inside the function 
> help with that? -- Andrei

Depending on how you choose optimize the certain cases.
You e.g. using sse2 instructions for copies of 128bit values,
It may become non-ctfeable.
Then you need a ctfeable branch in order for the function to 
still work at ctfe.


More information about the Dlang-internal mailing list