summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2017-11-16 23:08:57 +0000
committerCraig Topper <craig.topper@intel.com>2017-11-16 23:08:57 +0000
commit242374e2197fb96143eb8ed8b64c55ec444d81e8 (patch)
treea1a24800a16940faa725827423eab1f669d63820 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
parent12615ec49b745b0ed1ccacd1fa4d13d23d10751f (diff)
downloadbcm5719-llvm-242374e2197fb96143eb8ed8b64c55ec444d81e8.tar.gz
bcm5719-llvm-242374e2197fb96143eb8ed8b64c55ec444d81e8.zip
[X86] Don't remove sign extend of gather/scatter indices during SelectionDAGBuilder.
The sign extend might be from an i16 or i8 type and was inserted by InstCombine to match the pointer width. X86 gather legalization isn't currently detecting this to reinsert a sign extend to make things legal. It's a bit weird for the SelectionDAGBuilder to do this kind of optimization in the first place. With this removed we can at least lean on InstCombine somewhat to ensure the index is i32 or i64. I'll work on trying to recover some of the test cases by removing sign extends in the backend when its safe to do so with an understanding of the current legalizer capabilities. This should fix PR30690. llvm-svn: 318466
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp7
1 files changed, 0 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 2afd427d861..c2124c83c8d 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -3902,13 +3902,6 @@ static bool getUniformBase(const Value* &Ptr, SDValue& Base, SDValue& Index,
Base = SDB->getValue(Ptr);
Index = SDB->getValue(IndexVal);
- // Suppress sign extension.
- if (SExtInst* Sext = dyn_cast<SExtInst>(IndexVal)) {
- if (SDB->findValue(Sext->getOperand(0))) {
- IndexVal = Sext->getOperand(0);
- Index = SDB->getValue(IndexVal);
- }
- }
if (!Index.getValueType().isVector()) {
unsigned GEPWidth = GEP->getType()->getVectorNumElements();
EVT VT = EVT::getVectorVT(Context, Index.getValueType(), GEPWidth);
OpenPOWER on IntegriCloud