Skip to content

Commit 285cc89

Browse files
committed
Updates for review comments
1 parent 1cc855b commit 285cc89

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9553,11 +9553,10 @@ SDValue DAGCombiner::MatchLoadCombine(SDNode *N) {
95539553

95549554
// Try to find a tree of or's with leafs that are all loads that are offset from
95559555
// the same base, and can be combined to a single larger load.
9556-
static SDValue MatchOrOfLoadToLargeLoad(SDValue Root, SelectionDAG &DAG,
9556+
static SDValue matchOrOfLoadToLargeLoad(SDValue Root, SelectionDAG &DAG,
95579557
const TargetLowering &TLI) {
95589558
EVT VT = Root.getValueType();
9559-
SmallVector<SDValue> Worklist;
9560-
Worklist.push_back(Root);
9559+
SmallVector<SDValue> Worklist = {Root};
95619560
SmallVector<std::pair<LoadSDNode *, int64_t>> Loads;
95629561
std::optional<BaseIndexOffset> Base;
95639562
LoadSDNode *BaseLoad = nullptr;
@@ -28737,9 +28736,9 @@ SDValue DAGCombiner::SimplifySetCC(EVT VT, SDValue N0, SDValue N1,
2873728736
TLI.SimplifySetCC(VT, N0, N1, Cond, foldBooleans, DagCombineInfo, DL))
2873828737
return C;
2873928738

28740-
if ((Cond == ISD::SETNE || Cond == ISD::SETEQ) && isNullConstant(N1) &&
28741-
N0.getOpcode() == ISD::OR)
28742-
if (SDValue Load = MatchOrOfLoadToLargeLoad(N0, DAG, TLI))
28739+
if ((Cond == ISD::SETNE || Cond == ISD::SETEQ) && N0.getOpcode() == ISD::OR &&
28740+
isNullConstant(N1))
28741+
if (SDValue Load = matchOrOfLoadToLargeLoad(N0, DAG, TLI))
2874328742
return DAG.getSetCC(DL, VT, Load, N1, Cond);
2874428743
return SDValue();
2874528744
}

0 commit comments

Comments
 (0)