File tree 2 files changed +25
-1
lines changed
2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -623,8 +623,11 @@ bool AArch64RegisterBankInfo::isLoadFromFPType(const MachineInstr &MI) const {
623
623
EltTy = GV->getValueType ();
624
624
// Look at the first element of the struct to determine the type we are
625
625
// loading
626
- while (StructType *StructEltTy = dyn_cast<StructType>(EltTy))
626
+ while (StructType *StructEltTy = dyn_cast<StructType>(EltTy)) {
627
+ if (StructEltTy->getNumElements () == 0 )
628
+ break ;
627
629
EltTy = StructEltTy->getTypeAtIndex (0U );
630
+ }
628
631
// Look at the first element of the array to determine its type
629
632
if (isa<ArrayType>(EltTy))
630
633
EltTy = EltTy->getArrayElementType ();
Original file line number Diff line number Diff line change
1
+ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2
+ ; RUN: llc -mtriple=aarch64 -O0 -global-isel %s -o - 2>&1 | FileCheck %s
3
+
4
+ target triple = "arm64"
5
+
6
+ @p = external global { {}, { ptr } }
7
+
8
+ define void @foo () {
9
+ ; CHECK-LABEL: foo:
10
+ ; CHECK: // %bb.0: // %bb
11
+ ; CHECK-NEXT: adrp x8, :got:p
12
+ ; CHECK-NEXT: ldr x8, [x8, :got_lo12:p]
13
+ ; CHECK-NEXT: ldr x8, [x8]
14
+ ; CHECK-NEXT: mov x9, xzr
15
+ ; CHECK-NEXT: str x8, [x9]
16
+ ; CHECK-NEXT: ret
17
+ bb:
18
+ %i1 = load ptr , ptr @p , align 8
19
+ store ptr %i1 , ptr null , align 8
20
+ ret void
21
+ }
You can’t perform that action at this time.
0 commit comments