[PATCH] D135512: [AArch64][Windows] Check sret attribute also for inreg attribute
chenglin.bi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 11 01:09:18 PDT 2022
bcl5980 updated this revision to Diff 466723.
bcl5980 added a comment.
move the test to arm64-windows-calls.ll
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135512/new/
https://reviews.llvm.org/D135512
Files:
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/arm64-windows-calls.ll
Index: llvm/test/CodeGen/AArch64/arm64-windows-calls.ll
===================================================================
--- llvm/test/CodeGen/AArch64/arm64-windows-calls.ll
+++ llvm/test/CodeGen/AArch64/arm64-windows-calls.ll
@@ -176,3 +176,15 @@
; CHECK: bl copy_notpod
; CHECK-NEXT: stp x0, x1, [{{.*}}]
}
+
+; We shouldn't return the argument
+; when it has only inreg attribute
+define i64 @foobar(i64* inreg %0) {
+; CHECK-LABEL: foobar:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: ldr x0, [x0]
+; CHECK-NEXT: ret
+entry:
+ %1 = load i64, i64* %0
+ ret i64 %1
+}
Index: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
===================================================================
--- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -6248,7 +6248,7 @@
// epilogue.
if (IsWin64) {
for (unsigned I = 0, E = Ins.size(); I != E; ++I) {
- if (Ins[I].Flags.isInReg()) {
+ if (Ins[I].Flags.isInReg() && Ins[I].Flags.isSRet()) {
assert(!FuncInfo->getSRetReturnReg());
MVT PtrTy = getPointerTy(DAG.getDataLayout());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135512.466723.patch
Type: text/x-patch
Size: 1139 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221011/16a8441f/attachment.bin>
More information about the llvm-commits
mailing list