Skip to content

Commit 899ef15

Browse files
Add comment explaining type check
1 parent c85f2d4 commit 899ef15

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22217,6 +22217,9 @@ static SDValue performExtendCombine(SDNode *N,
2221722217
// any_extend. This means that we can replace this pattern with (rev16
2221822218
// (any_extend ...)). This saves a machine instruction compared to (lsr (rev
2221922219
// ...)), which is what this pattern would otherwise be lowered to.
22220+
// Only apply this optimisation if any_extend in original pattern to i32 or i64,
22221+
// because this type will become the input type to REV16 in the new pattern, so
22222+
// must be a legitimate REV16 input type.
2222022223
if (N->getOpcode() == ISD::ANY_EXTEND &&
2222122224
N->getOperand(0).getOpcode() == ISD::BSWAP &&
2222222225
N->getOperand(0).getValueType() == MVT::i16 &&

0 commit comments

Comments
 (0)