[PATCH] [DAGCombiner] Add support for FCEIL, FFLOOR and FTRUNC vector constant folding

Simon Pilgrim llvm-dev at redking.me.uk
Fri Apr 3 11:15:37 PDT 2015


REPOSITORY
  rL LLVM

================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2848
@@ -2847,2 +2847,3 @@
   if (BuildVectorSDNode *BV = dyn_cast<BuildVectorSDNode>(Operand.getNode())) {
-    if (BV->isConstant()) {
+    if (BV->isConstant() && VT.isVector()) {
+      EVT SVT = VT.getVectorElementType();
----------------
qcolombet wrote:
> Naive question: Is it possible to have a BuildVector without a VT for a vector?
Yes - x86_mmx registers choke on VT.getVectorElementType() if we don't have the VT.isVector() test to stop them.

================
Comment at: test/CodeGen/X86/vec_floor.ll:228
@@ +227,2 @@
+  ret <4 x float> %t
+}
----------------
qcolombet wrote:
> Could it be possible to add negative test when the conversion are not precise enough?
Yes I should be able to get something to work - probably with explicit hex values though.

http://reviews.llvm.org/D8715

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list