diff options
author | Igor Laevsky <igmyrj@gmail.com> | 2017-12-12 10:03:39 +0000 |
---|---|---|
committer | Igor Laevsky <igmyrj@gmail.com> | 2017-12-12 10:03:39 +0000 |
commit | d63560b8179d4dca1bce0dfa62888ec1eef32e6d (patch) | |
tree | 5c7c7e565f4742497aa73f4af4647c21fe311ff3 /llvm/lib | |
parent | f4ceb77cd98cb5da71f928826a6f309801f6ccc4 (diff) | |
download | bcm5719-llvm-d63560b8179d4dca1bce0dfa62888ec1eef32e6d.tar.gz bcm5719-llvm-d63560b8179d4dca1bce0dfa62888ec1eef32e6d.zip |
Revert r320049, r320014 and r319894
They were causing failures of the piglit OpenGL tests with AMD GPUs using the
Mesa radeonsi driver.
llvm-svn: 320466
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Analysis/InstructionSimplify.cpp | 28 | ||||
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp | 4 |
2 files changed, 0 insertions, 32 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index 09f516a8cb9..94de0c995d3 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/lib/Analysis/InstructionSimplify.cpp @@ -3827,28 +3827,6 @@ Value *llvm::SimplifyInsertValueInst(Value *Agg, Value *Val, return ::SimplifyInsertValueInst(Agg, Val, Idxs, Q, RecursionLimit); } -Value *llvm::SimplifyInsertElementInst(Value *Vec, Value *Val, Value *Idx, - const SimplifyQuery &Q) { - // Try to constant fold. - auto *VecC = dyn_cast<Constant>(Vec); - auto *ValC = dyn_cast<Constant>(Val); - auto *IdxC = dyn_cast<Constant>(Idx); - if (VecC && ValC && IdxC) - return ConstantFoldInsertElementInstruction(VecC, ValC, IdxC); - - // Fold into undef if index is out of bounds. - if (auto *CI = dyn_cast<ConstantInt>(Idx)) { - uint64_t NumElements = cast<VectorType>(Vec->getType())->getNumElements(); - - if (CI->uge(NumElements)) - return UndefValue::get(Vec->getType()); - } - - // TODO: We should also fold if index is iteslf an undef. - - return nullptr; -} - /// Given operands for an ExtractValueInst, see if we can fold the result. /// If not, this returns null. static Value *SimplifyExtractValueInst(Value *Agg, ArrayRef<unsigned> Idxs, @@ -4722,12 +4700,6 @@ Value *llvm::SimplifyInstruction(Instruction *I, const SimplifyQuery &SQ, IV->getIndices(), Q); break; } - case Instruction::InsertElement: { - auto *IE = cast<InsertElementInst>(I); - Result = SimplifyInsertElementInst(IE->getOperand(0), IE->getOperand(1), - IE->getOperand(2), Q); - break; - } case Instruction::ExtractValue: { auto *EVI = cast<ExtractValueInst>(I); Result = SimplifyExtractValueInst(EVI->getAggregateOperand(), diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp index 65a96b96522..6c99007475c 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp @@ -781,10 +781,6 @@ Instruction *InstCombiner::visitInsertElementInst(InsertElementInst &IE) { Value *ScalarOp = IE.getOperand(1); Value *IdxOp = IE.getOperand(2); - if (auto *V = SimplifyInsertElementInst( - VecOp, ScalarOp, IdxOp, SQ.getWithInstruction(&IE))) - return replaceInstUsesWith(IE, V); - // Inserting an undef or into an undefined place, remove this. if (isa<UndefValue>(ScalarOp) || isa<UndefValue>(IdxOp)) replaceInstUsesWith(IE, VecOp); |