Skip to content

Commit 7ccd0df

Browse files
Add check on any_extend output type
1 parent e2fb50c commit 7ccd0df

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22219,10 +22219,13 @@ static SDValue performExtendCombine(SDNode *N,
2221922219
// ...)), which is what this pattern would otherwise be lowered to.
2222022220
if (N->getOpcode() == ISD::ANY_EXTEND &&
2222122221
N->getOperand(0).getOpcode() == ISD::BSWAP &&
22222-
N->getOperand(0).getValueType() == MVT::i16) {
22222+
N->getOperand(0).getValueType() == MVT::i16 &&
22223+
(N->getValueType(0) == MVT::i32 ||
22224+
N->getValueType(0) == MVT::i64)) {
2222322225
SDNode *BswapNode = N->getOperand(0).getNode();
22226+
SDLoc DL(N);
2222422227
SDValue NewAnyExtend =
22225-
DAG.getNode(ISD::ANY_EXTEND, SDLoc(BswapNode), N->getValueType(0),
22228+
DAG.getNode(ISD::ANY_EXTEND, DL, N->getValueType(0),
2222622229
BswapNode->getOperand(0));
2222722230
return DAG.getNode(AArch64ISD::REV16, SDLoc(N), N->getValueType(0),
2222822231
NewAnyExtend);

0 commit comments

Comments
 (0)