[PATCH] D7299: Prevent hoisting fmul from THEN/ELSE to IF if there is fmsub/fmadd opportunity

Lawrence Hu via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 8 15:18:53 PDT 2016


hulx2000 added inline comments.

================
Comment at: lib/Target/AArch64/AArch64ISelLowering.cpp:6540
@@ +6539,3 @@
+/// Not profitable if I and it's user can form a FMA instruction
+/// because we prefer FMSUB/FMADD.
+bool AArch64TargetLowering::isProfitableToHoist(Instruction *I) const {
----------------
sebpop wrote:
> I think that this is only avoiding a bigger issue, that is currently the instruction selection happens on a single basic block.
> A better fix would be a machine pass that pairs multiplies with add/sub to form more FMAs.
> 
> 
Could you please explain what do you mean about avoiding a bigger issue?

================
Comment at: lib/Target/AArch64/AArch64ISelLowering.cpp:6561
@@ +6560,3 @@
+      (Options.AllowFPOpFusion == FPOpFusion::Fast || Options.UnsafeFPMath))
+    return false;
+
----------------
sebpop wrote:
> If both the multiply and the add/sub it feeds into can be hoisted, this code will still prevent multiplies to be hoisted.
I do agree about that.


Repository:
  rL LLVM

http://reviews.llvm.org/D7299





More information about the llvm-commits mailing list