[llvm] 478f2ce - [X86] Pull out repeated DemandedBits signmask variable. NFC.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sun May 24 04:05:41 PDT 2020
Author: Simon Pilgrim
Date: 2020-05-24T12:01:58+01:00
New Revision: 478f2ce5d3c44565b328c18d999deb6d1f3c7ee1
URL: https://github.com/llvm/llvm-project/commit/478f2ce5d3c44565b328c18d999deb6d1f3c7ee1
DIFF: https://github.com/llvm/llvm-project/commit/478f2ce5d3c44565b328c18d999deb6d1f3c7ee1.diff
LOG: [X86] Pull out repeated DemandedBits signmask variable. NFC.
Both paths always create the same DemandedBits mask.
Added:
Modified:
llvm/lib/Target/X86/X86ISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index cfabeee8f40d..ceeee364d07f 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -39145,12 +39145,13 @@ static SDValue combineVSelectToBLENDV(SDNode *N, SelectionDAG &DAG,
return true;
};
+ APInt DemandedBits(APInt::getSignMask(BitWidth));
+
if (OnlyUsedAsSelectCond(Cond)) {
- APInt DemandedMask(APInt::getSignMask(BitWidth));
KnownBits Known;
TargetLowering::TargetLoweringOpt TLO(DAG, !DCI.isBeforeLegalize(),
!DCI.isBeforeLegalizeOps());
- if (!TLI.SimplifyDemandedBits(Cond, DemandedMask, Known, TLO, 0, true))
+ if (!TLI.SimplifyDemandedBits(Cond, DemandedBits, Known, TLO, 0, true))
return SDValue();
// If we changed the computation somewhere in the DAG, this change will
@@ -39172,10 +39173,9 @@ static SDValue combineVSelectToBLENDV(SDNode *N, SelectionDAG &DAG,
}
// Otherwise we can still at least try to simplify multiple use bits.
- APInt DemandedBits(APInt::getSignMask(BitWidth));
if (SDValue V = TLI.SimplifyMultipleUseDemandedBits(Cond, DemandedBits, DAG))
- return DAG.getNode(X86ISD::BLENDV, SDLoc(N), N->getValueType(0), V,
- N->getOperand(1), N->getOperand(2));
+ return DAG.getNode(X86ISD::BLENDV, SDLoc(N), N->getValueType(0), V,
+ N->getOperand(1), N->getOperand(2));
return SDValue();
}
More information about the llvm-commits
mailing list