summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2018-12-05 10:37:45 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2018-12-05 10:37:45 +0000
commitd24730cdda57d76f980980085a17b041edc0df35 (patch)
tree9e4950b5a41e8ef79271e5ce0b79894f5ba90cc3 /llvm/lib/CodeGen
parent8a1b4f57c9aa86603d900dbb595ca56c74d9c7b8 (diff)
downloadbcm5719-llvm-d24730cdda57d76f980980085a17b041edc0df35.tar.gz
bcm5719-llvm-d24730cdda57d76f980980085a17b041edc0df35.zip
[TargetLowering] SimplifyDemandedVectorElts - don't alter DemandedElts mask
Fix potential issue with the ISD::INSERT_VECTOR_ELT case tweaking the DemandedElts mask instead of using a local copy - so later uses of the mask use the tweaked version..... Noticed while investigating adding zero/undef folding to SimplifyDemandedVectorElts and the altered DemandedElts mask was causing mismatches. llvm-svn: 348348
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 33dad187d4a..04303d682d3 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -1614,9 +1614,10 @@ bool TargetLowering::SimplifyDemandedVectorElts(
unsigned Idx = CIdx->getZExtValue();
if (!DemandedElts[Idx])
return TLO.CombineTo(Op, Vec);
- DemandedElts.clearBit(Idx);
- if (SimplifyDemandedVectorElts(Vec, DemandedElts, KnownUndef,
+ APInt DemandedVecElts(DemandedElts);
+ DemandedVecElts.clearBit(Idx);
+ if (SimplifyDemandedVectorElts(Vec, DemandedVecElts, KnownUndef,
KnownZero, TLO, Depth + 1))
return true;
OpenPOWER on IntegriCloud