[llvm] r280391 - Rename some variables to have meaningful names. NFC.
Michael Kuperstein via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 1 11:24:42 PDT 2016
Author: mkuper
Date: Thu Sep 1 13:24:42 2016
New Revision: 280391
URL: http://llvm.org/viewvc/llvm-project?rev=280391&view=rev
Log:
Rename some variables to have meaningful names. NFC.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp?rev=280391&r1=280390&r2=280391&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Thu Sep 1 13:24:42 2016
@@ -2838,51 +2838,51 @@ void DAGTypeLegalizer::IntegerExpandSetC
case ISD::SETUGE: LowCC = ISD::SETUGE; break;
}
- // Tmp1 = lo(op1) < lo(op2) // Always unsigned comparison
- // Tmp2 = hi(op1) < hi(op2) // Signedness depends on operands
- // dest = hi(op1) == hi(op2) ? Tmp1 : Tmp2;
+ // LoCmp = lo(op1) < lo(op2) // Always unsigned comparison
+ // HiCmp = hi(op1) < hi(op2) // Signedness depends on operands
+ // dest = hi(op1) == hi(op2) ? LoCmp : HiCmp;
// NOTE: on targets without efficient SELECT of bools, we can always use
// this identity: (B1 ? B2 : B3) --> (B1 & B2)|(!B1&B3)
TargetLowering::DAGCombinerInfo DagCombineInfo(DAG, AfterLegalizeTypes, true,
nullptr);
- SDValue Tmp1, Tmp2;
+ SDValue LoCmp, HiCmp;
if (TLI.isTypeLegal(LHSLo.getValueType()) &&
TLI.isTypeLegal(RHSLo.getValueType()))
- Tmp1 = TLI.SimplifySetCC(getSetCCResultType(LHSLo.getValueType()),
- LHSLo, RHSLo, LowCC, false, DagCombineInfo, dl);
- if (!Tmp1.getNode())
- Tmp1 = DAG.getSetCC(dl, getSetCCResultType(LHSLo.getValueType()),
- LHSLo, RHSLo, LowCC);
+ LoCmp = TLI.SimplifySetCC(getSetCCResultType(LHSLo.getValueType()), LHSLo,
+ RHSLo, LowCC, false, DagCombineInfo, dl);
+ if (!LoCmp.getNode())
+ LoCmp = DAG.getSetCC(dl, getSetCCResultType(LHSLo.getValueType()), LHSLo,
+ RHSLo, LowCC);
if (TLI.isTypeLegal(LHSHi.getValueType()) &&
TLI.isTypeLegal(RHSHi.getValueType()))
- Tmp2 = TLI.SimplifySetCC(getSetCCResultType(LHSHi.getValueType()),
- LHSHi, RHSHi, CCCode, false, DagCombineInfo, dl);
- if (!Tmp2.getNode())
- Tmp2 = DAG.getNode(ISD::SETCC, dl,
- getSetCCResultType(LHSHi.getValueType()),
- LHSHi, RHSHi, DAG.getCondCode(CCCode));
-
- ConstantSDNode *Tmp1C = dyn_cast<ConstantSDNode>(Tmp1.getNode());
- ConstantSDNode *Tmp2C = dyn_cast<ConstantSDNode>(Tmp2.getNode());
- if ((Tmp1C && Tmp1C->isNullValue()) ||
- (Tmp2C && Tmp2C->isNullValue() &&
- (CCCode == ISD::SETLE || CCCode == ISD::SETGE ||
- CCCode == ISD::SETUGE || CCCode == ISD::SETULE)) ||
- (Tmp2C && Tmp2C->getAPIntValue() == 1 &&
- (CCCode == ISD::SETLT || CCCode == ISD::SETGT ||
- CCCode == ISD::SETUGT || CCCode == ISD::SETULT))) {
+ HiCmp = TLI.SimplifySetCC(getSetCCResultType(LHSHi.getValueType()), LHSHi,
+ RHSHi, CCCode, false, DagCombineInfo, dl);
+ if (!HiCmp.getNode())
+ HiCmp =
+ DAG.getNode(ISD::SETCC, dl, getSetCCResultType(LHSHi.getValueType()),
+ LHSHi, RHSHi, DAG.getCondCode(CCCode));
+
+ ConstantSDNode *LoCmpC = dyn_cast<ConstantSDNode>(LoCmp.getNode());
+ ConstantSDNode *HiCmpC = dyn_cast<ConstantSDNode>(HiCmp.getNode());
+ if ((LoCmpC && LoCmpC->isNullValue()) ||
+ (HiCmpC && HiCmpC->isNullValue() &&
+ (CCCode == ISD::SETLE || CCCode == ISD::SETGE || CCCode == ISD::SETUGE ||
+ CCCode == ISD::SETULE)) ||
+ (HiCmpC && HiCmpC->getAPIntValue() == 1 &&
+ (CCCode == ISD::SETLT || CCCode == ISD::SETGT || CCCode == ISD::SETUGT ||
+ CCCode == ISD::SETULT))) {
// low part is known false, returns high part.
// For LE / GE, if high part is known false, ignore the low part.
// For LT / GT, if high part is known true, ignore the low part.
- NewLHS = Tmp2;
+ NewLHS = HiCmp;
NewRHS = SDValue();
return;
}
if (LHSHi == RHSHi) {
// Comparing the low bits is enough.
- NewLHS = Tmp1;
+ NewLHS = LoCmp;
NewRHS = SDValue();
return;
}
@@ -2927,8 +2927,8 @@ void DAGTypeLegalizer::IntegerExpandSetC
if (!NewLHS.getNode())
NewLHS = DAG.getSetCC(dl, getSetCCResultType(LHSHi.getValueType()),
LHSHi, RHSHi, ISD::SETEQ);
- NewLHS = DAG.getSelect(dl, Tmp1.getValueType(),
- NewLHS, Tmp1, Tmp2);
+ NewLHS = DAG.getSelect(dl, LoCmp.getValueType(),
+ NewLHS, LoCmp, HiCmp);
NewRHS = SDValue();
}
More information about the llvm-commits
mailing list