[LLVMdev] LLVM ARM VMLA instruction

Tim Northover t.p.northover at gmail.com
Wed Dec 18 10:17:31 PST 2013


> http://llvm.org/bugs/show_bug.cgi?id=17188
> http://llvm.org/bugs/show_bug.cgi?id=17211

Ah, thanks. That makes a lot more sense now.

> Correct - clang is different than gcc, icc, msvc, xlc, etc. on this. Still
> haven't seen any explanation for how this is better though...

That would be because it follows what C tells us a compiler has to do
by default but provides overrides in either direction if you know what
you're doing.

The key point is that LLVM (currently) has no notion of statement
boundaries, so it would fuse the operations in this function:

float foo(float accum, float lhs, float rhs) {
  float product = lhs * rhs;
  return accum + product;
}

This isn't allowed even under FP_CONTRACT=on (the multiply and add do
not occur within a single expression), so LLVM can't in good
conscience enable these optimisations by default.

Cheers.

Tim.



More information about the llvm-dev mailing list