From 88522ce38892808818c835497e850fba6ae3448c Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sun, 2 Jun 2019 10:12:55 +0000 Subject: [PATCH] [TargetLowering] SimplifyDemandedBits - don't use OriginalDemanded variables in analysis. These might have been replaced in multiple use cases. llvm-svn: 362322 --- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 43251d0..785530b 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -676,27 +676,27 @@ bool TargetLowering::SimplifyDemandedBits( // If index isn't constant, assume we need all vector elements AND the // inserted element. - APInt DemandedVecElts(OriginalDemandedElts); + APInt DemandedVecElts(DemandedElts); if (CIdx && CIdx->getAPIntValue().ult(VecVT.getVectorNumElements())) { unsigned Idx = CIdx->getZExtValue(); DemandedVecElts.clearBit(Idx); // Inserted element is not required. - if (!OriginalDemandedElts[Idx]) + if (!DemandedElts[Idx]) return TLO.CombineTo(Op, Vec); } KnownBits KnownScl; unsigned NumSclBits = Scl.getScalarValueSizeInBits(); - APInt DemandedSclBits = OriginalDemandedBits.zextOrTrunc(NumSclBits); + APInt DemandedSclBits = DemandedBits.zextOrTrunc(NumSclBits); if (SimplifyDemandedBits(Scl, DemandedSclBits, KnownScl, TLO, Depth + 1)) return true; Known = KnownScl.zextOrTrunc(BitWidth, false); KnownBits KnownVec; - if (SimplifyDemandedBits(Vec, OriginalDemandedBits, DemandedVecElts, - KnownVec, TLO, Depth + 1)) + if (SimplifyDemandedBits(Vec, DemandedBits, DemandedVecElts, KnownVec, TLO, + Depth + 1)) return true; if (!!DemandedVecElts) { -- 2.7.4