[PATCH] Fix interference caused by fmul 2, x -> fadd x, x combine

hfinkel at anl.gov hfinkel at anl.gov
Tue Sep 2 11:32:01 PDT 2014


LGTM.

================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:691
@@ +690,3 @@
+
+    // BuildVectors can truncate their operands. Ignore that case here.
+    // FIXME: We blindly ignore splats which include undef which is overly
----------------
arsenm wrote:
> hfinkel wrote:
> > BV can only truncate integer operands, not FP ones. If you want to check that the types agree, please make it an assert.
> This was already added in another patch which also used this. I can fix this separately
Okay, thanks! (please do).

================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:6875
@@ +6874,3 @@
+    // during an early run of DAGCombiner can prevent folding with fmuls
+    // inserted during lowering.
+    if (N0.getOpcode() == ISD::FADD && N0.getOperand(0) == N0.getOperand(1)) {
----------------
arsenm wrote:
> hfinkel wrote:
> > Okay, but what happens next? Wouldn't we get (fmul x, (fadd c, c))?
> The fmul 2.0, c will be constant folded into 2c which is the goal
Okay, makes sense. ;)

http://reviews.llvm.org/D4678






More information about the llvm-commits mailing list