Skip to content

Commit d541ac2

Browse files
committed
[GlobalISel] Bail out early for big-endian
If we continue through the function we can currently hit crashes. We can bail out early and fall back to SDAG.
1 parent 277ca48 commit d541ac2

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3889,6 +3889,7 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &CurMF) {
38893889
F.getSubprogram(), &F.getEntryBlock());
38903890
R << "unable to translate in big endian mode";
38913891
reportTranslationError(*MF, *TPC, *ORE, R);
3892+
return false;
38923893
}
38933894

38943895
// Release the per-function state when we return, whether we succeeded or not.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2+
; RUN: llc -mtriple aarch64-unknown-linux-musl -O0 < %s | FileCheck %s --check-prefix=CHECK-LE
3+
; RUN: llc -mtriple aarch64_be-unknown-linux-musl -O0 < %s | FileCheck %s --check-prefix=CHECK-BE
4+
5+
; Make sure we fall-back to SDAG for BE targets.
6+
7+
define <4 x i6> @foo(float %0, <4 x i6> %1) {
8+
; CHECK-LE-LABEL: foo:
9+
; CHECK-LE: // %bb.0:
10+
; CHECK-LE-NEXT: fmov d0, d1
11+
; CHECK-LE-NEXT: ret
12+
;
13+
; CHECK-BE-LABEL: foo:
14+
; CHECK-BE: // %bb.0:
15+
; CHECK-BE-NEXT: fmov d0, d1
16+
; CHECK-BE-NEXT: ret
17+
ret <4 x i6> %1
18+
}

0 commit comments

Comments
 (0)