Skip to content

Commit fccc70e

Browse files
author
anoopkg6
committed
Incorporated suggestions in review.
1 parent 132cf31 commit fccc70e

File tree

6 files changed

+80
-72
lines changed

6 files changed

+80
-72
lines changed

clang/include/clang/Basic/TargetInfo.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,10 +1114,12 @@ class TargetInfo : public TransferrableTargetInfo,
11141114

11151115
std::string ConstraintStr; // constraint: "=rm"
11161116
std::string Name; // Operand name: [foo] with no []'s.
1117+
unsigned FlagOutputCCUpperBound;
1118+
11171119
public:
11181120
ConstraintInfo(StringRef ConstraintStr, StringRef Name)
11191121
: Flags(0), TiedOperand(-1), ConstraintStr(ConstraintStr.str()),
1120-
Name(Name.str()) {
1122+
Name(Name.str()), FlagOutputCCUpperBound(2) {
11211123
ImmRange.Min = ImmRange.Max = 0;
11221124
ImmRange.isConstrained = false;
11231125
}
@@ -1188,6 +1190,14 @@ class TargetInfo : public TransferrableTargetInfo,
11881190
TiedOperand = N;
11891191
// Don't copy Name or constraint string.
11901192
}
1193+
1194+
// CC range can be set by target. SystemZ sets it to 4. It is 2 by default.
1195+
void setFlagOutputCCUpperBound(unsigned CCBound) {
1196+
FlagOutputCCUpperBound = CCBound;
1197+
}
1198+
unsigned getFlagOutputCCUpperBound() const {
1199+
return FlagOutputCCUpperBound;
1200+
}
11911201
};
11921202

11931203
/// Validate register name used for global register variables.
@@ -1229,10 +1239,6 @@ class TargetInfo : public TransferrableTargetInfo,
12291239
return true;
12301240
}
12311241

1232-
// CC is binary on most targets. SystemZ overrides it as CC interval is
1233-
// [0, 4).
1234-
virtual unsigned getFlagOutputCCUpperBound() const { return 2; }
1235-
12361242
virtual bool
12371243
validateAsmConstraint(const char *&Name,
12381244
TargetInfo::ConstraintInfo &info) const = 0;

clang/lib/Basic/Targets/SystemZ.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ bool SystemZTargetInfo::validateAsmConstraint(
103103
if (!StringRef("@cc").compare(Name)) {
104104
Name += 2;
105105
Info.setAllowsRegister();
106+
Info.setFlagOutputCCUpperBound(4);
106107
return true;
107108
}
108109
return false;

clang/lib/Basic/Targets/SystemZ.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,13 @@ class LLVM_LIBRARY_VISIBILITY SystemZTargetInfo : public TargetInfo {
115115
return RegName == "r15";
116116
}
117117

118-
// CC has interval [0, 4).
119-
unsigned getFlagOutputCCUpperBound() const override { return 4; }
120118
bool validateAsmConstraint(const char *&Name,
121119
TargetInfo::ConstraintInfo &info) const override;
122120

123121
std::string convertConstraint(const char *&Constraint) const override {
124-
if (llvm::StringRef(Constraint).starts_with("@cc")) {
122+
if (llvm::StringRef(Constraint) == "@cc") {
125123
auto Len = llvm::StringRef("@cc").size();
126-
std::string Converted =
127-
std::string("{") + std::string(Constraint, Len) + std::string("}");
124+
std::string Converted = std::string("{@cc}");
128125
Constraint += Len - 1;
129126
return Converted;
130127
}

clang/lib/CodeGen/CGStmt.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2624,8 +2624,18 @@ EmitAsmStores(CodeGenFunction &CGF, const AsmStmt &S,
26242624
// Lowering 'Tmp' as - 'icmp ult %Tmp , CCUpperBound'. On some targets
26252625
// CCUpperBound is not binary. CCUpperBound is 4 for SystemZ,
26262626
// interval [0, 4). With this range known, llvm.assume intrinsic guides
2627-
// optimizer to generate more optimized IR. Verified it for SystemZ.
2628-
unsigned CCUpperBound = CGF.getTarget().getFlagOutputCCUpperBound();
2627+
// optimizer to generate more optimized IR in most of the cases as
2628+
// observed for select_cc on SystemZ unit tests for flag output operands.
2629+
// For some cases for br_cc, generated IR was weird. e.g. switch table
2630+
// for simple simple comparison terms for br_cc.
2631+
StringRef Name;
2632+
if (const GCCAsmStmt *GAS = dyn_cast<GCCAsmStmt>(&S))
2633+
Name = GAS->getOutputName(i);
2634+
TargetInfo::ConstraintInfo Info(S.getOutputConstraint(i), Name);
2635+
bool IsValid = CGF.getTarget().validateOutputConstraint(Info);
2636+
(void)IsValid;
2637+
assert(IsValid && "Failed to parse flag output operand constraint");
2638+
unsigned CCUpperBound = Info.getFlagOutputCCUpperBound();
26292639
llvm::Constant *CCUpperBoundConst =
26302640
llvm::ConstantInt::get(Tmp->getType(), CCUpperBound);
26312641
llvm::Value *IsBooleanValue =

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2838,11 +2838,6 @@ void SelectionDAGBuilder::visitBr(const BranchInst &I) {
28382838
else if (match(BOp, m_LogicalOr(m_Value(BOp0), m_Value(BOp1))))
28392839
Opcode = Instruction::Or;
28402840
auto &TLI = DAG.getTargetLoweringInfo();
2841-
bool BrSrlIPM = FuncInfo.MF->getTarget().getTargetTriple().getArch() ==
2842-
Triple::ArchType::systemz;
2843-
// For Flag output operands SRL/IPM sequence, we want to avoid
2844-
// creating switch case, as it creates Basic Block and inhibits
2845-
// optimization in DAGCombiner for flag output operands.
28462841
const auto checkSRLIPM = [&TLI](const SDValue &Op) {
28472842
if (!Op.getNumOperands())
28482843
return false;
@@ -2859,13 +2854,15 @@ void SelectionDAGBuilder::visitBr(const BranchInst &I) {
28592854
}
28602855
return false;
28612856
};
2862-
if (BrSrlIPM) {
2863-
if (NodeMap.count(BOp0) && NodeMap[BOp0].getNode()) {
2864-
BrSrlIPM &= checkSRLIPM(getValue(BOp0));
2865-
if (NodeMap.count(BOp1) && NodeMap[BOp1].getNode())
2866-
BrSrlIPM &= checkSRLIPM(getValue(BOp1));
2867-
} else
2868-
BrSrlIPM = false;
2857+
// Incoming IR here is straight line code, FindMergedConditions splits
2858+
// condition code sequence across Basic Block. DAGCombiner can't combine
2859+
// across Basic Block. Identify SRL/IPM/CC sequence for SystemZ and avoid
2860+
// transformation in FindMergedConditions.
2861+
bool BrSrlIPM = false;
2862+
if (NodeMap.count(BOp0) && NodeMap[BOp0].getNode()) {
2863+
BrSrlIPM |= checkSRLIPM(getValue(BOp0));
2864+
if (NodeMap.count(BOp1) && NodeMap[BOp1].getNode())
2865+
BrSrlIPM &= checkSRLIPM(getValue(BOp1));
28692866
}
28702867
if (Opcode && !BrSrlIPM &&
28712868
!(match(BOp0, m_ExtractElt(m_Value(Vec), m_Value())) &&
@@ -12141,20 +12138,15 @@ void SelectionDAGBuilder::lowerWorkItem(SwitchWorkListItem W, Value *Cond,
1214112138
const APInt &SmallValue = Small.Low->getValue();
1214212139
const APInt &BigValue = Big.Low->getValue();
1214312140

12144-
// Creating switch cases optimizing tranformation inhibits DAGCombiner
12145-
// for SystemZ for flag output operands. DAGCobiner compute cumulative
12146-
// CCMask for flag output operands SRL/IPM sequence, we want to avoid
12147-
// creating switch case, as it creates Basic Block and inhibits
12148-
// optimization in DAGCombiner for flag output operands.
12149-
// cases like (CC == 0) || (CC == 2) || (CC == 3), or
12141+
// Incoming IR is switch table.Identify SRL/IPM/CC sequence for SystemZ
12142+
// and we want to avoid splitting condition code sequence across basic
12143+
// block for cases like (CC == 0) || (CC == 2) || (CC == 3), or
1215012144
// (CC == 0) || (CC == 1) ^ (CC == 3), there could potentially be
1215112145
// more cases like this.
1215212146
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
1215312147
bool IsSrlIPM = false;
1215412148
if (NodeMap.count(Cond) && NodeMap[Cond].getNode())
12155-
IsSrlIPM = CurMF->getTarget().getTargetTriple().getArch() ==
12156-
Triple::ArchType::systemz &&
12157-
TLI.canLowerSRL_IPM_Switch(getValue(Cond));
12149+
IsSrlIPM = TLI.canLowerSRL_IPM_Switch(getValue(Cond));
1215812150
// Check that there is only one bit different.
1215912151
APInt CommonBit = BigValue ^ SmallValue;
1216012152
if (CommonBit.isPowerOf2() || IsSrlIPM) {

llvm/lib/Target/SystemZ/SystemZISelLowering.cpp

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,6 +1482,14 @@ SystemZTargetLowering::getConstraintType(StringRef Constraint) const {
14821482
return TargetLowering::getConstraintType(Constraint);
14831483
}
14841484

1485+
// Convert condition code in CCReg to an i32 value.
1486+
static SDValue getCCResult(SelectionDAG &DAG, SDValue CCReg) {
1487+
SDLoc DL(CCReg);
1488+
SDValue IPM = DAG.getNode(SystemZISD::IPM, DL, MVT::i32, CCReg);
1489+
return DAG.getNode(ISD::SRL, DL, MVT::i32, IPM,
1490+
DAG.getConstant(SystemZ::IPM_CC, DL, MVT::i32));
1491+
}
1492+
14851493
TargetLowering::ConstraintWeight SystemZTargetLowering::
14861494
getSingleConstraintMatchWeight(AsmOperandInfo &info,
14871495
const char *constraint) const {
@@ -1717,12 +1725,7 @@ SDValue SystemZTargetLowering::LowerAsmOutputForConstraint(
17171725
Chain = Glue.getValue(1);
17181726
} else
17191727
Glue = DAG.getCopyFromReg(Chain, DL, SystemZ::CC, MVT::i32);
1720-
1721-
SDValue IPM = DAG.getNode(SystemZISD::IPM, DL, MVT::i32, Glue);
1722-
SDValue CC = DAG.getNode(ISD::SRL, DL, MVT::i32, IPM,
1723-
DAG.getConstant(SystemZ::IPM_CC, DL, MVT::i32));
1724-
1725-
return CC;
1728+
return getCCResult(DAG, Glue);
17261729
}
17271730

17281731
void SystemZTargetLowering::LowerAsmOperandForConstraint(
@@ -5227,14 +5230,6 @@ SDValue SystemZTargetLowering::lowerPREFETCH(SDValue Op,
52275230
Node->getMemoryVT(), Node->getMemOperand());
52285231
}
52295232

5230-
// Convert condition code in CCReg to an i32 value.
5231-
static SDValue getCCResult(SelectionDAG &DAG, SDValue CCReg) {
5232-
SDLoc DL(CCReg);
5233-
SDValue IPM = DAG.getNode(SystemZISD::IPM, DL, MVT::i32, CCReg);
5234-
return DAG.getNode(ISD::SRL, DL, MVT::i32, IPM,
5235-
DAG.getConstant(SystemZ::IPM_CC, DL, MVT::i32));
5236-
}
5237-
52385233
SDValue
52395234
SystemZTargetLowering::lowerINTRINSIC_W_CHAIN(SDValue Op,
52405235
SelectionDAG &DAG) const {
@@ -8082,7 +8077,7 @@ SDValue SystemZTargetLowering::combineBSWAP(
80828077
}
80838078

80848079
// Combine IPM sequence for flag output operands.
8085-
static bool combineCCIPMMask(SDValue &CCReg, int &CCValid, int &CCMask) {
8080+
static bool combineSRL_IPM_CCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
80868081
// Convert CCVal to CCMask and update it along with CCValid.
80878082
const auto convertCCValToCCMask = [&CCMask, &CCValid](int CCVal) {
80888083
bool Invert = false;
@@ -8121,6 +8116,8 @@ static bool combineCCIPMMask(SDValue &CCReg, int &CCValid, int &CCMask) {
81218116
if (!IPMOp0 || IPMOp0->getNumOperands() < 2)
81228117
return false;
81238118
auto *RN = dyn_cast<RegisterSDNode>(IPMOp0->getOperand(1));
8119+
// Check if operand 1 is SystemZ::CC. Also, it avoids srl/ipm/tbegin and
8120+
// srl/ipm/tend kind of sequences.
81248121
if (!RN || !RN->getReg().isPhysical() || RN->getReg() != SystemZ::CC)
81258122
return false;
81268123
// Return the updated CCReg link.
@@ -8177,7 +8174,7 @@ static bool combineCCIPMMask(SDValue &CCReg, int &CCValid, int &CCMask) {
81778174
return false;
81788175
int CCValidVal = CCValid1->getZExtValue();
81798176
int CCMaskVal = CCMask1->getZExtValue();
8180-
if (combineCCIPMMask(XORReg, CCValidVal, CCMaskVal)) {
8177+
if (combineSRL_IPM_CCMask(XORReg, CCValidVal, CCMaskVal)) {
81818178
// CC == 0 || CC == 2 for bit 28 Test Under Mask.
81828179
CCMask = SystemZ::CCMASK_CMP_GE;
81838180
CCMask ^= CCMaskVal;
@@ -8217,7 +8214,7 @@ static bool combineCCIPMMask(SDValue &CCReg, int &CCValid, int &CCMask) {
82178214
int CCValidVal = CCValidNode->getZExtValue();
82188215
int CCMaskVal = CCMaskNode->getZExtValue();
82198216
SDValue CCRegOp = CCNode->getOperand(4);
8220-
if (combineCCIPMMask(CCRegOp, CCValidVal, CCMaskVal) ||
8217+
if (combineSRL_IPM_CCMask(CCRegOp, CCValidVal, CCMaskVal) ||
82218218
isCCOperand(CCRegOp.getNode())) {
82228219
CCMask = CCMaskVal;
82238220
CCValid = SystemZ::CCMASK_ANY;
@@ -8252,8 +8249,8 @@ static bool combineCCIPMMask(SDValue &CCReg, int &CCValid, int &CCMask) {
82528249
int CCMaskVal2 = CCMask2->getZExtValue();
82538250
SDValue CCReg1 = XOROp1->getOperand(4);
82548251
SDValue CCReg2 = XOROp2->getOperand(4);
8255-
if (!combineCCIPMMask(CCReg1, CCValidVal1, CCMaskVal1) ||
8256-
!combineCCIPMMask(CCReg2, CCValidVal2, CCMaskVal2))
8252+
if (!combineSRL_IPM_CCMask(CCReg1, CCValidVal1, CCMaskVal1) ||
8253+
!combineSRL_IPM_CCMask(CCReg2, CCValidVal2, CCMaskVal2))
82578254
return false;
82588255
CCMask = CCMaskVal1 ^ CCMaskVal2;
82598256
CCReg = CCReg1;
@@ -8280,8 +8277,8 @@ static bool combineCCIPMMask(SDValue &CCReg, int &CCValid, int &CCMask) {
82808277
SDValue CmpOp2 = CCNode->getOperand(1);
82818278
int CCValid1 = CCValid, CCValid2 = CCValid;
82828279
int CCMask1 = CCMask, CCMask2 = CCMask;
8283-
bool IsOp1 = combineCCIPMMask(CmpOp1, CCValid1, CCMask1);
8284-
bool IsOp2 = combineCCIPMMask(CmpOp2, CCValid2, CCMask2);
8280+
bool IsOp1 = combineSRL_IPM_CCMask(CmpOp1, CCValid1, CCMask1);
8281+
bool IsOp2 = combineSRL_IPM_CCMask(CmpOp2, CCValid2, CCMask2);
82858282
if (IsOp1 && IsOp2) {
82868283
CCMask = CCMask1 ^ CCMask2;
82878284
CCReg = CmpOp1;
@@ -8300,7 +8297,7 @@ static bool combineCCIPMMask(SDValue &CCReg, int &CCValid, int &CCMask) {
83008297
if (CCMask == SystemZ::CCMASK_CMP_NE)
83018298
Invert = !Invert;
83028299
SDValue NewCCReg = CCNode->getOperand(0);
8303-
if (combineCCIPMMask(NewCCReg, CCValid, CCMask)) {
8300+
if (combineSRL_IPM_CCMask(NewCCReg, CCValid, CCMask)) {
83048301
CCMask |= Mask;
83058302
if (Invert)
83068303
CCMask ^= SystemZ::CCMASK_ANY;
@@ -8320,8 +8317,8 @@ static bool combineCCIPMMask(SDValue &CCReg, int &CCValid, int &CCMask) {
83208317
SDValue OrOp2 = LHS->getOperand(1);
83218318
int NewCCMask1 = CCMask, NewCCMask2 = CCMask, NewCCMask = CCMask;
83228319
if (!isa<ConstantSDNode>(OrOp1) && !isa<ConstantSDNode>(OrOp2)) {
8323-
bool IsOp1 = combineCCIPMMask(OrOp1, CCValid, NewCCMask1);
8324-
bool IsOp2 = combineCCIPMMask(OrOp2, CCValid, NewCCMask2);
8320+
bool IsOp1 = combineSRL_IPM_CCMask(OrOp1, CCValid, NewCCMask1);
8321+
bool IsOp2 = combineSRL_IPM_CCMask(OrOp2, CCValid, NewCCMask2);
83258322
if (!IsOp1 && !IsOp2) {
83268323
CCValid = RestoreCCValid;
83278324
return false;
@@ -8364,8 +8361,8 @@ static bool combineCCIPMMask(SDValue &CCReg, int &CCValid, int &CCMask) {
83648361
int NewCCMask2 = CCMask;
83658362
int NewCCMask;
83668363
if (!isa<ConstantSDNode>(AndOp1) && !isa<ConstantSDNode>(AndOp2)) {
8367-
bool IsOp1 = combineCCIPMMask(AndOp1, CCValid, NewCCMask1);
8368-
bool IsOp2 = combineCCIPMMask(AndOp2, CCValid, NewCCMask2);
8364+
bool IsOp1 = combineSRL_IPM_CCMask(AndOp1, CCValid, NewCCMask1);
8365+
bool IsOp2 = combineSRL_IPM_CCMask(AndOp2, CCValid, NewCCMask2);
83698366
if (!IsOp1 && !IsOp2) {
83708367
CCValid = RestoreCCValid;
83718368
return false;
@@ -8455,7 +8452,7 @@ static bool combineCCIPMMask(SDValue &CCReg, int &CCValid, int &CCMask) {
84558452
if (CCMask == SystemZ::CCMASK_CMP_NE)
84568453
Invert = !Invert;
84578454
// If both the operands are select_cc.
8458-
if (combineCCIPMMask(XORReg, CCValid, CCMask)) {
8455+
if (combineSRL_IPM_CCMask(XORReg, CCValid, CCMask)) {
84598456
CCReg = XORReg;
84608457
CCValid = SystemZ::CCMASK_ANY;
84618458
return true;
@@ -8479,8 +8476,8 @@ static bool combineCCIPMMask(SDValue &CCReg, int &CCValid, int &CCMask) {
84798476
SDValue XORReg1 = XOROp->getOperand(4);
84808477
SDValue XORReg2 = LHS->getOperand(1);
84818478
int CCMaskVal1 = CCMaskVal, CCMaskVal2 = CCMaskVal;
8482-
if (combineCCIPMMask(XORReg1, CCValidVal, CCMaskVal1) &&
8483-
combineCCIPMMask(XORReg2, CCValidVal, CCMaskVal2)) {
8479+
if (combineSRL_IPM_CCMask(XORReg1, CCValidVal, CCMaskVal1) &&
8480+
combineSRL_IPM_CCMask(XORReg2, CCValidVal, CCMaskVal2)) {
84848481
CCMask = CCMaskVal1 ^ CCMaskVal2;
84858482
CCReg = XORReg1;
84868483
CCValid = SystemZ::CCMASK_ANY;
@@ -8493,6 +8490,17 @@ static bool combineCCIPMMask(SDValue &CCReg, int &CCValid, int &CCMask) {
84938490
}
84948491

84958492
static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
8493+
// combineSRL_IPM_CCMask tries to combine srl/ipm/cc sequence.
8494+
// This sequence here seems to be only for flag output operand.
8495+
// IPM operand has physical operand SystemZ::CC and CCValid is 15.
8496+
if (combineSRL_IPM_CCMask(CCReg, CCValid, CCMask))
8497+
return true;
8498+
8499+
// Code for SELECT_CCMASK does not seem to have ipm sequence.
8500+
// There is one case with sra/ipm that does not have SystemZ::CC as an
8501+
// operand. Test cases for sra/ipm are bcmp.ll, memcmp-01.ll and
8502+
// strcmp-01.ll. These tests have sra/sll/ipm/clc sequence.
8503+
84968504
// We have a SELECT_CCMASK or BR_CCMASK comparing the condition code
84978505
// set by the CCReg instruction using the CCValid / CCMask masks,
84988506
// If the CCReg instruction is itself a ICMP testing the condition
@@ -8545,7 +8553,6 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
85458553
CCReg = CompareLHS->getOperand(4);
85468554
return true;
85478555
}
8548-
85498556
// Optimize the case where CompareRHS is (SRA (SHL (IPM))).
85508557
if (CompareLHS->getOpcode() == ISD::SRA) {
85518558
auto *SRACount = dyn_cast<ConstantSDNode>(CompareLHS->getOperand(1));
@@ -8575,7 +8582,6 @@ static bool combineCCMask(SDValue &CCReg, int &CCValid, int &CCMask) {
85758582
CCReg = IPM->getOperand(0);
85768583
return true;
85778584
}
8578-
85798585
return false;
85808586
}
85818587

@@ -8642,7 +8648,7 @@ SystemZTargetLowering::combineSELECT_CC_CCIPMMask(SDNode *N,
86428648
SDValue CCReg = N->getOperand(4);
86438649
SDValue CCRegOp = CCOpNode->getOperand(4);
86448650
// Combine current select_cc.
8645-
if (combineCCIPMMask(CCReg, CCValid, CCMask)) {
8651+
if (combineSRL_IPM_CCMask(CCReg, CCValid, CCMask)) {
86468652
if (InvertOp1)
86478653
CCMask ^= SystemZ::CCMASK_ANY;
86488654
// There are two scenarios here.
@@ -8652,7 +8658,7 @@ SystemZTargetLowering::combineSELECT_CC_CCIPMMask(SDNode *N,
86528658
// SELECT_CCMASK. Check for isCCOperand. In this case we will not know
86538659
// original CCMask, but if only one bit is set in CCMaskValOp, that means
86548660
// original CCMask was SystemZ::CCMASK_CMP_EQ.
8655-
if (!combineCCIPMMask(CCRegOp, CCValidValOp, CCMaskValOp) &&
8661+
if (!combineSRL_IPM_CCMask(CCRegOp, CCValidValOp, CCMaskValOp) &&
86568662
!isCCOperand(CCRegOp.getNode()))
86578663
return std::nullopt;
86588664
// If outer SELECT_CCMASK is CCMASK_CMP_EQ or single bit is set in
@@ -8722,9 +8728,7 @@ SDValue SystemZTargetLowering::combineBR_CCMASK(
87228728
SDValue Chain = N->getOperand(0);
87238729
SDValue CCReg = N->getOperand(4);
87248730

8725-
// combineCCIPMMask tries to combine srl/ipm sequence for flag output operand.
8726-
if (combineCCIPMMask(CCReg, CCValidVal, CCMaskVal) ||
8727-
combineCCMask(CCReg, CCValidVal, CCMaskVal))
8731+
if (combineCCMask(CCReg, CCValidVal, CCMaskVal))
87288732
return DAG.getNode(SystemZISD::BR_CCMASK, SDLoc(N), N->getValueType(0),
87298733
Chain,
87308734
DAG.getTargetConstant(CCValidVal, SDLoc(N), MVT::i32),
@@ -8753,9 +8757,7 @@ SDValue SystemZTargetLowering::combineSELECT_CCMASK(
87538757
int CCMaskVal = CCMask->getZExtValue();
87548758
SDValue CCReg = N->getOperand(4);
87558759

8756-
// combineCCIPMMask tries to combine srl/ipm sequence for flag output operand.
8757-
if (combineCCIPMMask(CCReg, CCValidVal, CCMaskVal) ||
8758-
combineCCMask(CCReg, CCValidVal, CCMaskVal))
8760+
if (combineCCMask(CCReg, CCValidVal, CCMaskVal))
87598761
return DAG.getNode(SystemZISD::SELECT_CCMASK, SDLoc(N), N->getValueType(0),
87608762
N->getOperand(0), N->getOperand(1),
87618763
DAG.getTargetConstant(CCValidVal, SDLoc(N), MVT::i32),

0 commit comments

Comments
 (0)