[llvm] 9c06c10 - [SelectionDAG] GetDemandedBits - fallback to SimplifyMultipleUseDemandedBits by default.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 20 08:52:29 PST 2020
Author: Simon Pilgrim
Date: 2020-01-20T16:51:52Z
New Revision: 9c06c10fbae941feaf2738962d7ee58745b33725
URL: https://github.com/llvm/llvm-project/commit/9c06c10fbae941feaf2738962d7ee58745b33725
DIFF: https://github.com/llvm/llvm-project/commit/9c06c10fbae941feaf2738962d7ee58745b33725.diff
LOG: [SelectionDAG] GetDemandedBits - fallback to SimplifyMultipleUseDemandedBits by default.
First step towards removing SelectionDAG::GetDemandedBits entirely since it so similar to SimplifyMultipleUseDemandedBits anyhow.
Added:
Modified:
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 90476641d620..e191abb154fe 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -2184,6 +2184,8 @@ SDValue SelectionDAG::GetDemandedBits(SDValue V, const APInt &DemandedBits,
const APInt &DemandedElts) {
switch (V.getOpcode()) {
default:
+ return TLI->SimplifyMultipleUseDemandedBits(V, DemandedBits, DemandedElts,
+ *this, 0);
break;
case ISD::Constant: {
auto *CV = cast<ConstantSDNode>(V.getNode());
@@ -2194,11 +2196,6 @@ SDValue SelectionDAG::GetDemandedBits(SDValue V, const APInt &DemandedBits,
return getConstant(NewVal, SDLoc(V), V.getValueType());
break;
}
- case ISD::OR:
- case ISD::XOR:
- case ISD::SIGN_EXTEND_INREG:
- return TLI->SimplifyMultipleUseDemandedBits(V, DemandedBits, DemandedElts,
- *this, 0);
case ISD::SRL:
// Only look at single-use SRLs.
if (!V.getNode()->hasOneUse())
More information about the llvm-commits
mailing list