Fix the issue: #57684
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D135512
// 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());
; 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
+}