File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -600,8 +600,11 @@ bool AArch64RegisterBankInfo::isLoadFromFPType(const MachineInstr &MI) const {
600600 EltTy = GV->getValueType ();
601601 // Look at the first element of the struct to determine the type we are
602602 // loading
603- while (StructType *StructEltTy = dyn_cast<StructType>(EltTy))
603+ while (StructType *StructEltTy = dyn_cast<StructType>(EltTy)) {
604+ if (StructEltTy->getNumElements () == 0 )
605+ break ;
604606 EltTy = StructEltTy->getTypeAtIndex (0U );
607+ }
605608 // Look at the first element of the array to determine its type
606609 if (isa<ArrayType>(EltTy))
607610 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