How to prevent optimizer from reordering stuff?

David Nadlinger via digitalmars-d-ldc digitalmars-d-ldc at
Sun Mar 15 10:49:41 PDT 2015

Hi Dan,

On 03/14/2015 09:20 PM, Dan Olson via digitalmars-d-ldc wrote:
> I don't see any attributes for for that function.  I will just paste
> some of the -output-ll results since nothing sticks out to me.

Yeah, seems like everything is in order (no pun intended) after the main 
IR-level optimizer. This suggests that the reordering happens on the 
target-specific optimization or instruction selection level. I suppose 
you could try disabling codegen optimizations if you wanted to 
investigate this further.

> Maybe that means the compiler can says FPSCR state from my vdiv.f64
> is undefined across function call boundaries, so ordering should not
> matter?

This seems like a reasonable guess. Did you try asking on the LLVM IRC 
channel or mailing list? Depending on the outcome (i.e. if the ABI is 
really to be interpreted that way), we should probably discuss its 
implications for D's FP handling strategy on the main D mailing lists.


More information about the digitalmars-d-ldc mailing list