Skip to content

Commit 53965f2

Browse files
Fix AMD infinite loop
1 parent d3b68b1 commit 53965f2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6036,6 +6036,10 @@ SDValue DAGCombiner::hoistLogicOpWithSameOpcodeHands(SDNode *N) {
60366036
HandOpcode == ISD::ANY_EXTEND_VECTOR_INREG) &&
60376037
LegalTypes && !TLI.isTypeDesirableForOp(LogicOpcode, XVT))
60386038
return SDValue();
6039+
// Prevent an infinite loop if the target prefers the inverse
6040+
// transformation.
6041+
if (TLI.isNarrowingProfitable(N, XVT, VT))
6042+
return SDValue();
60396043
// logic_op (hand_op X), (hand_op Y) --> hand_op (logic_op X, Y)
60406044
SDNodeFlags LogicFlags;
60416045
LogicFlags.setDisjoint(N->getFlags().hasDisjoint() &&

0 commit comments

Comments
 (0)