Skip to content

Commit 3d65f82

Browse files
[SVE] Expand scalable vector ISD::BITCASTs when targeting big-endian.
Whilst sub-optimial, it's better than the current selection failure. Fixes: #64406 Differential Revision: https://reviews.llvm.org/D157406
1 parent e5a524b commit 3d65f82

File tree

2 files changed

+1689
-1
lines changed

2 files changed

+1689
-1
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,9 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
13371337
setOperationAction(ISD::AVGFLOORU, VT, Custom);
13381338
setOperationAction(ISD::AVGCEILS, VT, Custom);
13391339
setOperationAction(ISD::AVGCEILU, VT, Custom);
1340+
1341+
if (!Subtarget->isLittleEndian())
1342+
setOperationAction(ISD::BITCAST, VT, Expand);
13401343
}
13411344

13421345
// Illegal unpacked integer vector types.
@@ -1486,6 +1489,9 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
14861489
setCondCodeAction(ISD::SETUGT, VT, Expand);
14871490
setCondCodeAction(ISD::SETUEQ, VT, Expand);
14881491
setCondCodeAction(ISD::SETONE, VT, Expand);
1492+
1493+
if (!Subtarget->isLittleEndian())
1494+
setOperationAction(ISD::BITCAST, VT, Expand);
14891495
}
14901496

14911497
for (auto VT : {MVT::nxv2bf16, MVT::nxv4bf16, MVT::nxv8bf16}) {
@@ -1495,6 +1501,9 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
14951501
setOperationAction(ISD::MLOAD, VT, Custom);
14961502
setOperationAction(ISD::INSERT_SUBVECTOR, VT, Custom);
14971503
setOperationAction(ISD::SPLAT_VECTOR, VT, Legal);
1504+
1505+
if (!Subtarget->isLittleEndian())
1506+
setOperationAction(ISD::BITCAST, VT, Expand);
14981507
}
14991508

15001509
setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::i8, Custom);

0 commit comments

Comments
 (0)