summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-03-07 17:41:45 +0000
committerSanjay Patel <spatel@rotateright.com>2017-03-07 17:41:45 +0000
commit6d306061686954e7f831309caba7b6b1f6c61e25 (patch)
tree3697ddc03980b3eb76c9ba235a2fbea973af4f80 /llvm/lib/Transforms
parentd4056501fbda79f6d9100a483762daa173403caa (diff)
downloadbcm5719-llvm-6d306061686954e7f831309caba7b6b1f6c61e25.tar.gz
bcm5719-llvm-6d306061686954e7f831309caba7b6b1f6c61e25.zip
revert r297155 because there's a clang test that depends on InstCombine:
tools/clang/test/CodeGen/zvector.c llvm-svn: 297166
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp20
1 files changed, 0 insertions, 20 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
index a1ac64dda35..e60687fa7ad 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
@@ -463,23 +463,6 @@ Instruction *InstCombiner::shrinkBitwiseLogic(TruncInst &Trunc) {
return BinaryOperator::Create(LogicOp->getOpcode(), NarrowOp0, NarrowC);
}
-/// Try to narrow the width of a splat shuffle. This could be generalized to any
-/// shuffle with a constant operand, but we limit the transform to avoid
-/// creating a shuffle type that targets may not be able to lower effectively.
-static Instruction *shrinkSplatShuffle(TruncInst &Trunc,
- InstCombiner::BuilderTy &Builder) {
- auto *Shuf = dyn_cast<ShuffleVectorInst>(Trunc.getOperand(0));
- if (Shuf && Shuf->hasOneUse() && isa<UndefValue>(Shuf->getOperand(1)) &&
- Shuf->getMask()->getSplatValue()) {
- // trunc (shuf X, Undef, SplatMask) --> shuf (trunc X), Undef, SplatMask
- Constant *NarrowUndef = UndefValue::get(Trunc.getType());
- Value *NarrowOp = Builder.CreateTrunc(Shuf->getOperand(0), Trunc.getType());
- return new ShuffleVectorInst(NarrowOp, NarrowUndef, Shuf->getMask());
- }
-
- return nullptr;
-}
-
Instruction *InstCombiner::visitTrunc(TruncInst &CI) {
if (Instruction *Result = commonCastTransforms(CI))
return Result;
@@ -571,9 +554,6 @@ Instruction *InstCombiner::visitTrunc(TruncInst &CI) {
if (Instruction *I = shrinkBitwiseLogic(CI))
return I;
- if (Instruction *I = shrinkSplatShuffle(CI, *Builder))
- return I;
-
if (Src->hasOneUse() && isa<IntegerType>(SrcTy) &&
shouldChangeType(SrcTy, DestTy)) {
// Transform "trunc (shl X, cst)" -> "shl (trunc X), cst" so long as the
OpenPOWER on IntegriCloud