[llvm] [RISCV][GISel] Reverse the operands the buildStore created in legalizeVAStart. (PR #73989)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 8 09:48:26 PST 2023


================
@@ -0,0 +1,41 @@
+# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
+# RUN: llc -mtriple=riscv32 -run-pass=legalizer %s -o - | FileCheck --check-prefix=RV32 %s
+
+--- |
+  declare void @llvm.va_start(ptr) #0
+
+  define void @test_va_start(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr %5, ptr %6, ptr %7, ...) {
+    %va = alloca ptr
+    call void @llvm.va_start(ptr %va)
+    ret void
+  }
+
+  attributes #0 = { nocallback nofree nosync nounwind willreturn }
+
+...
+---
+name:            test_va_start
+tracksRegLiveness: true
+fixedStack:
+  - { id: 0, size: 4, alignment: 16, isImmutable: true }
----------------
michaelmaitland wrote:

I have a question that does not block this PR:

> got the ABI alignment for a pointer.

> stack pointer is 16 byte aligned when a function starts so the alignment is 16

Why is the ABI alignment for a pointer different than the stack pointer 16 byte alignment at function start?

https://github.com/llvm/llvm-project/pull/73989


More information about the llvm-commits mailing list