[PATCH] D19391: transform masking off of an FP sign bit into a fabs...but only if it's legal!

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 22 07:00:13 PDT 2016


spatel added inline comments.

================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:7344
@@ +7343,3 @@
+    SDValue AndOp0 = N0->getOperand(0);
+    ConstantSDNode *AndOp1 = dyn_cast<ConstantSDNode>(N0->getOperand(1));
+    if (AndOp1 && AndOp1->getAPIntValue().isMaxSignedValue() &&
----------------
RKSimon wrote:
> Can isConstOrConstSplat be used here to allow this combine to work on vectors as well?
Yes, I thought about adding that, but my guess was that it wouldn't have much impact since vector bitcasts are usually free and hopefully removed elsewhere. 

Also, the InstCombine doesn't handle vectors, so this was the 1-to-1 replacement. I can add a TODO comment for vectors though.


http://reviews.llvm.org/D19391





More information about the llvm-commits mailing list