Skip to content

Commit 04c83ff

Browse files
committed
address comment
1 parent f92136d commit 04c83ff

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15590,20 +15590,17 @@ SDValue PPCTargetLowering::DAGCombineExtBoolTrunc(SDNode *N,
1559015590
// The function check a i128 load can convert to 16i8 load for Vcmpequb.
1559115591
static bool canConvertToVcmpequb(SDValue &LHS, SDValue &RHS) {
1559215592

15593-
auto isValidForConvert = [](SDValue &Oprand) {
15594-
if (Oprand.getOpcode() == ISD::Constant)
15595-
return true;
15596-
15597-
if (Oprand.getOpcode() != ISD::LOAD)
15593+
auto isValidForConvert = [](SDValue &Operand) {
15594+
if (!Operand.hasOneUse())
1559815595
return false;
1559915596

15600-
if (!Oprand.hasOneUse())
15597+
if (Operand.getValueType() != MVT::i128)
1560115598
return false;
1560215599

15603-
if (Oprand.getValueType() != MVT::i128)
15604-
return false;
15600+
if (Operand.getOpcode() == ISD::Constant)
15601+
return true;
1560515602

15606-
auto *LoadNode = dyn_cast<LoadSDNode>(Oprand);
15603+
auto *LoadNode = dyn_cast<LoadSDNode>(Operand);
1560715604
if (!LoadNode)
1560815605
return false;
1560915606

@@ -15645,13 +15642,13 @@ SDValue convertTwoLoadsAndCmpToVCMPEQUB(SelectionDAG &DAG, SDNode *N,
1564515642
assert(CC == ISD::SETNE ||
1564615643
CC == ISD::SETEQ && "CC mus be ISD::SETNE or ISD::SETEQ");
1564715644

15648-
auto getV16i8Load = [&](const SDValue &Oprand) {
15649-
if (Oprand.getOpcode() == ISD::Constant)
15650-
return DAG.getBitcast(MVT::v16i8, Oprand);
15645+
auto getV16i8Load = [&](const SDValue &Operand) {
15646+
if (Operand.getOpcode() == ISD::Constant)
15647+
return DAG.getBitcast(MVT::v16i8, Operand);
1565115648

15652-
assert(Oprand.getOpcode() == ISD::LOAD && "Must be LoadSDNode here.");
15649+
assert(Operand.getOpcode() == ISD::LOAD && "Must be LoadSDNode here.");
1565315650

15654-
auto *LoadNode = dyn_cast<LoadSDNode>(Oprand);
15651+
auto *LoadNode = cast<LoadSDNode>(Operand);
1565515652
return DAG.getLoad(MVT::v16i8, DL, LoadNode->getChain(),
1565615653
LoadNode->getBasePtr(), LoadNode->getMemOperand());
1565715654
};

0 commit comments

Comments
 (0)