[llvm] 1ad3648 - [LegalizeDAG] Use SelectionDAG::getBoolConstant to simplify some code. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 6 10:10:56 PDT 2022
Author: Craig Topper
Date: 2022-04-06T10:08:11-07:00
New Revision: 1ad36487e95dfb46cf15a9f1cf5f48f9210d8032
URL: https://github.com/llvm/llvm-project/commit/1ad36487e95dfb46cf15a9f1cf5f48f9210d8032
DIFF: https://github.com/llvm/llvm-project/commit/1ad36487e95dfb46cf15a9f1cf5f48f9210d8032.diff
LOG: [LegalizeDAG] Use SelectionDAG::getBoolConstant to simplify some code. NFC
Added:
Modified:
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index b7bef0bca1390..dab6f0accd7e1 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -3635,20 +3635,10 @@ bool SelectionDAGLegalize::ExpandNode(SDNode *Node) {
// Otherwise, SETCC for the given comparison type must be completely
// illegal; expand it into a SELECT_CC.
EVT VT = Node->getValueType(0);
- int TrueValue;
- switch (TLI.getBooleanContents(Tmp1.getValueType())) {
- case TargetLowering::ZeroOrOneBooleanContent:
- case TargetLowering::UndefinedBooleanContent:
- TrueValue = 1;
- break;
- case TargetLowering::ZeroOrNegativeOneBooleanContent:
- TrueValue = -1;
- break;
- }
+ EVT Tmp1VT = Tmp1.getValueType();
Tmp1 = DAG.getNode(ISD::SELECT_CC, dl, VT, Tmp1, Tmp2,
- DAG.getConstant(TrueValue, dl, VT),
- DAG.getConstant(0, dl, VT),
- Tmp3);
+ DAG.getBoolConstant(true, dl, VT, Tmp1VT),
+ DAG.getBoolConstant(false, dl, VT, Tmp1VT), Tmp3);
Tmp1->setFlags(Node->getFlags());
Results.push_back(Tmp1);
break;
More information about the llvm-commits
mailing list