There was an error while loading. Please reload this page.
1 parent d3b68b1 commit 53965f2Copy full SHA for 53965f2
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -6036,6 +6036,10 @@ SDValue DAGCombiner::hoistLogicOpWithSameOpcodeHands(SDNode *N) {
6036
HandOpcode == ISD::ANY_EXTEND_VECTOR_INREG) &&
6037
LegalTypes && !TLI.isTypeDesirableForOp(LogicOpcode, XVT))
6038
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();
6043
// logic_op (hand_op X), (hand_op Y) --> hand_op (logic_op X, Y)
6044
SDNodeFlags LogicFlags;
6045
LogicFlags.setDisjoint(N->getFlags().hasDisjoint() &&
0 commit comments