summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2016-03-17 15:59:36 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2016-03-17 15:59:36 +0000
commit0f37fbac51743051a5bc739778fc92da05efdc70 (patch)
tree7ec2d4bb63f016e8f052cd12ce81a0781e542e18 /llvm/lib/Target
parent9e23fedaf0f84d4a020514df4beefe65fe6da50b (diff)
downloadbcm5719-llvm-0f37fbac51743051a5bc739778fc92da05efdc70.tar.gz
bcm5719-llvm-0f37fbac51743051a5bc739778fc92da05efdc70.zip
[X86][SSE] Simplified blend-with-zero combining
We were being too aggressive in trying to combine a shuffle into a blend-with-zero pattern, often resulting in a endless loop of contrasting combines This patch stops the combine if we already have a blend in place (means we miss some domain corrections) llvm-svn: 263717
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp27
1 files changed, 13 insertions, 14 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index f557a72aa0f..e0e46d912b5 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -1919,7 +1919,7 @@ EVT X86TargetLowering::getSetCCResultType(const DataLayout &DL,
EVT LegalVT = getTypeToTransformTo(Context, VT);
EltVT = LegalVT.getVectorElementType().getSimpleVT();
}
-
+
if (Subtarget.hasVLX() && EltVT.getSizeInBits() >= 32)
switch(NumElts) {
case 2: return MVT::v2i1;
@@ -23958,23 +23958,22 @@ static bool combineX86ShuffleChain(SDValue Input, SDValue Root,
unsigned ShuffleSize = ShuffleVT.getVectorNumElements();
unsigned MaskRatio = ShuffleSize / Mask.size();
+ if (Depth == 1 && Root.getOpcode() == X86ISD::BLENDI)
+ return false;
+
for (unsigned i = 0; i != ShuffleSize; ++i)
if (Mask[i / MaskRatio] < 0)
BlendMask |= 1u << i;
- if (Depth != 1 || RootVT != ShuffleVT ||
- Root.getOpcode() != X86ISD::BLENDI ||
- Root->getConstantOperandVal(2) != BlendMask) {
- SDValue Zero = getZeroVector(ShuffleVT, Subtarget, DAG, DL);
- Res = DAG.getBitcast(ShuffleVT, Input);
- DCI.AddToWorklist(Res.getNode());
- Res = DAG.getNode(X86ISD::BLENDI, DL, ShuffleVT, Res, Zero,
- DAG.getConstant(BlendMask, DL, MVT::i8));
- DCI.AddToWorklist(Res.getNode());
- DCI.CombineTo(Root.getNode(), DAG.getBitcast(RootVT, Res),
- /*AddTo*/ true);
- return true;
- }
+ SDValue Zero = getZeroVector(ShuffleVT, Subtarget, DAG, DL);
+ Res = DAG.getBitcast(ShuffleVT, Input);
+ DCI.AddToWorklist(Res.getNode());
+ Res = DAG.getNode(X86ISD::BLENDI, DL, ShuffleVT, Res, Zero,
+ DAG.getConstant(BlendMask, DL, MVT::i8));
+ DCI.AddToWorklist(Res.getNode());
+ DCI.CombineTo(Root.getNode(), DAG.getBitcast(RootVT, Res),
+ /*AddTo*/ true);
+ return true;
}
}
OpenPOWER on IntegriCloud