diff options
| author | Renato Golin <renato.golin@linaro.org> | 2015-08-30 10:05:30 +0000 |
|---|---|---|
| committer | Renato Golin <renato.golin@linaro.org> | 2015-08-30 10:05:30 +0000 |
| commit | c7be31736ca0cbd7fca41989b805228cf87e4355 (patch) | |
| tree | 74999b0f23780bf846583fec7996b79eda30c95a /llvm/lib/CodeGen/SelectionDAG | |
| parent | 5543fbc9b2a3a345bf7f79297677fe888252e3c9 (diff) | |
| download | bcm5719-llvm-c7be31736ca0cbd7fca41989b805228cf87e4355.tar.gz bcm5719-llvm-c7be31736ca0cbd7fca41989b805228cf87e4355.zip | |
Revert "New interface function is added to VectorUtils Value *getSplatValue(Value *Val);"
This reverts commit r246371, as it cause a rather obscure bug in AArch64
test-suite paq8p (time outs, seg-faults). I'll investigate it before
reapplying.
llvm-svn: 246379
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index c958f7df019..63328200f8d 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -22,7 +22,6 @@ #include "llvm/Analysis/ConstantFolding.h" #include "llvm/Analysis/TargetLibraryInfo.h" #include "llvm/Analysis/ValueTracking.h" -#include "llvm/Analysis/VectorUtils.h" #include "llvm/CodeGen/FastISel.h" #include "llvm/CodeGen/FunctionLoweringInfo.h" #include "llvm/CodeGen/GCMetadata.h" @@ -3151,32 +3150,37 @@ static bool getUniformBase(Value *& Ptr, SDValue& Base, SDValue& Index, SelectionDAGBuilder* SDB) { assert(Ptr->getType()->isVectorTy() && "Unexpected pointer type"); - GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Ptr); - if (!GEP || GEP->getNumOperands() > 2) + GetElementPtrInst *Gep = dyn_cast<GetElementPtrInst>(Ptr); + if (!Gep || Gep->getNumOperands() > 2) return false; - Value *GEPPtrs = GEP->getPointerOperand(); - if (!(Ptr = getSplatValue(GEPPtrs))) + ShuffleVectorInst *ShuffleInst = + dyn_cast<ShuffleVectorInst>(Gep->getPointerOperand()); + if (!ShuffleInst || !ShuffleInst->getMask()->isNullValue() || + cast<Instruction>(ShuffleInst->getOperand(0))->getOpcode() != + Instruction::InsertElement) return false; + Ptr = cast<InsertElementInst>(ShuffleInst->getOperand(0))->getOperand(1); + SelectionDAG& DAG = SDB->DAG; const TargetLowering &TLI = DAG.getTargetLoweringInfo(); // Check is the Ptr is inside current basic block // If not, look for the shuffle instruction if (SDB->findValue(Ptr)) Base = SDB->getValue(Ptr); - else if (SDB->findValue(GEPPtrs)) { - SDValue GEPPtrsVal = SDB->getValue(GEPPtrs); - SDLoc sdl = GEPPtrsVal; - EVT IdxVT = TLI.getVectorIdxTy(DAG.getDataLayout()); - Base = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, sdl, - GEPPtrsVal.getValueType().getScalarType(), GEPPtrsVal, - DAG.getConstant(0, sdl, IdxVT)); + else if (SDB->findValue(ShuffleInst)) { + SDValue ShuffleNode = SDB->getValue(ShuffleInst); + SDLoc sdl = ShuffleNode; + Base = DAG.getNode( + ISD::EXTRACT_VECTOR_ELT, sdl, + ShuffleNode.getValueType().getScalarType(), ShuffleNode, + DAG.getConstant(0, sdl, TLI.getVectorIdxTy(DAG.getDataLayout()))); SDB->setValue(Ptr, Base); } else return false; - Value *IndexVal = GEP->getOperand(1); + Value *IndexVal = Gep->getOperand(1); if (SDB->findValue(IndexVal)) { Index = SDB->getValue(IndexVal); |

