[PATCH] D132007: [NFC][M68k][test] Fix incorrect use of `getelementptr`
Sheng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 16 20:44:05 PDT 2022
0x59616e created this revision.
0x59616e added reviewers: myhsu, RKSimon.
Herald added a project: All.
0x59616e requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
It turns out that issue #56990 is caused by the misuse of getelementptr in `link-unlnk.ll`.
https://reviews.llvm.org/D132007
Files:
llvm/test/CodeGen/M68k/link-unlnk.ll
Index: llvm/test/CodeGen/M68k/link-unlnk.ll
===================================================================
--- llvm/test/CodeGen/M68k/link-unlnk.ll
+++ llvm/test/CodeGen/M68k/link-unlnk.ll
@@ -17,18 +17,18 @@
; FP-NEXT: move.l %d1, (-32,%a6)
; FP-NEXT: move.l (12,%a6), %d0
; FP-NEXT: add.l %d0, %d1
-; FP-NEXT: move.l %d0, (0,%a6)
+; FP-NEXT: move.l %d0, (-28,%a6)
; FP-NEXT: add.l %d1, %d0
-; FP-NEXT: move.l %d1, (32,%a6)
+; FP-NEXT: move.l %d1, (-24,%a6)
; FP-NEXT: add.l %d0, %d1
-; FP-NEXT: move.l %d0, (64,%a6)
-; FP-NEXT: move.l %d1, (96,%a6)
+; FP-NEXT: move.l %d0, (-20,%a6)
+; FP-NEXT: move.l %d1, (-16,%a6)
; FP-NEXT: add.l %d1, %d0
-; FP-NEXT: move.l %d0, (128,%a6)
+; FP-NEXT: move.l %d0, (-12,%a6)
; FP-NEXT: add.l %d0, %d1
-; FP-NEXT: move.l %d1, (160,%a6)
+; FP-NEXT: move.l %d1, (-8,%a6)
; FP-NEXT: add.l %d1, %d0
-; FP-NEXT: move.l %d0, (192,%a6)
+; FP-NEXT: move.l %d0, (-4,%a6)
; FP-NEXT: unlk %a6
; FP-NEXT: rts
;
@@ -41,35 +41,35 @@
; NO-FP-NEXT: move.l %d1, (0,%sp)
; NO-FP-NEXT: move.l (40,%sp), %d0
; NO-FP-NEXT: add.l %d0, %d1
-; NO-FP-NEXT: move.l %d0, (32,%sp)
+; NO-FP-NEXT: move.l %d0, (4,%sp)
; NO-FP-NEXT: add.l %d1, %d0
-; NO-FP-NEXT: move.l %d1, (64,%sp)
+; NO-FP-NEXT: move.l %d1, (8,%sp)
; NO-FP-NEXT: add.l %d0, %d1
-; NO-FP-NEXT: move.l %d0, (96,%sp)
-; NO-FP-NEXT: move.l %d1, (128,%sp)
+; NO-FP-NEXT: move.l %d0, (12,%sp)
+; NO-FP-NEXT: move.l %d1, (16,%sp)
; NO-FP-NEXT: add.l %d1, %d0
-; NO-FP-NEXT: move.l %d0, (160,%sp)
+; NO-FP-NEXT: move.l %d0, (20,%sp)
; NO-FP-NEXT: add.l %d0, %d1
-; NO-FP-NEXT: move.l %d1, (192,%sp)
+; NO-FP-NEXT: move.l %d1, (24,%sp)
; NO-FP-NEXT: add.l %d1, %d0
-; NO-FP-NEXT: move.l %d0, (224,%sp)
+; NO-FP-NEXT: move.l %d0, (28,%sp)
; NO-FP-NEXT: adda.l #32, %sp
; NO-FP-NEXT: rts
entry:
%arr = alloca [8 x i32], align 4
- %s0 = getelementptr [8 x i32], ptr %arr, i32 0
- %s1 = getelementptr [8 x i32], ptr %arr, i32 1
+ %s0 = getelementptr i32, ptr %arr, i32 0
+ %s1 = getelementptr i32, ptr %arr, i32 1
store i32 %a, i32* %s0
store i32 %b, i32* %s1
- %ptr0 = getelementptr [8 x i32], ptr %arr, i32 0
- %ptr1 = getelementptr [8 x i32], ptr %arr, i32 1
- %ptr2 = getelementptr [8 x i32], ptr %arr, i32 2
- %ptr3 = getelementptr [8 x i32], ptr %arr, i32 3
- %ptr4 = getelementptr [8 x i32], ptr %arr, i32 4
- %ptr5 = getelementptr [8 x i32], ptr %arr, i32 5
- %ptr6 = getelementptr [8 x i32], ptr %arr, i32 6
- %ptr7 = getelementptr [8 x i32], ptr %arr, i32 7
+ %ptr0 = getelementptr i32, ptr %arr, i32 0
+ %ptr1 = getelementptr i32, ptr %arr, i32 1
+ %ptr2 = getelementptr i32, ptr %arr, i32 2
+ %ptr3 = getelementptr i32, ptr %arr, i32 3
+ %ptr4 = getelementptr i32, ptr %arr, i32 4
+ %ptr5 = getelementptr i32, ptr %arr, i32 5
+ %ptr6 = getelementptr i32, ptr %arr, i32 6
+ %ptr7 = getelementptr i32, ptr %arr, i32 7
%res0 = load i32, i32 * %ptr0
%res1 = load i32, i32 * %ptr1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132007.453192.patch
Type: text/x-patch
Size: 3061 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220817/041e0588/attachment.bin>
More information about the llvm-commits
mailing list