[PATCH] [DAGCombiner] Fix & simplify constant folding of sext/zext.
chfast at gmail.com
Mon Jun 22 14:37:22 PDT 2015
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:5611
@@ -5613,4 +5610,3 @@
if (Opcode == ISD::SIGN_EXTEND || Opcode == ISD::SIGN_EXTEND_VECTOR_INREG)
- DL, SVT));
+ Elts.push_back(DAG.getConstant(C.sextOrTrunc(VTBits), DL, SVT));
> I think you need to just drop the 'getZExtValue()' and keep as a APInt:
> Elts.push_back(DAG.getConstant(C.shl(ShAmt).ashr(ShAmt), DL, SVT);
That's definitely safer change. But isn't it the same?
More information about the llvm-commits