LLVM ARM VMLA instruction


I was going through Code of LLVM instruction code generation for ARM. I came across VMLA instruction hazards (Floating point multiply and accumulate). I was comparing assembly code emitted by LLVM and GCC, where i saw that GCC was happily using VMLA instruction for floating point while LLVM never used it, instead it used a pair of VMUL and VADD instruction.

I wanted to know if there is any way in which these VMLA hazards can be ignored and make LLVM to emit VMLA instructions? Is there any command line option/compiler switch/FLAG for doing this? I tried ‘-ffast-math’ but it didn’t work.

I believe the option you're looking for is: -mattr=-vmlx-forwarding

$ llc -mcpu=cortex-a9 -mattr=-vmlx-forwarding file.ll -0 file.s