[llvm-commits] [llvm] r53479 - in /llvm/branches/Apple/Gaz: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/x86-64-frameaddr.ll
Bill Wendling
isanbard at gmail.com
Fri Jul 11 15:36:20 PDT 2008
Author: void
Date: Fri Jul 11 17:36:20 2008
New Revision: 53479
URL: http://llvm.org/viewvc/llvm-project?rev=53479&view=rev
Log:
Pull r53450 into Gaz:
The frame address on an x86-64 box needs to be offset by -8, not -4.
Added:
llvm/branches/Apple/Gaz/test/CodeGen/X86/x86-64-frameaddr.ll
Modified:
llvm/branches/Apple/Gaz/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/branches/Apple/Gaz/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Gaz/lib/Target/X86/X86ISelLowering.cpp?rev=53479&r1=53478&r2=53479&view=diff
==============================================================================
--- llvm/branches/Apple/Gaz/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/branches/Apple/Gaz/lib/Target/X86/X86ISelLowering.cpp Fri Jul 11 17:36:20 2008
@@ -5348,7 +5348,7 @@
SDOperand RetAddrFI = getReturnAddressFrameIndex(DAG);
return DAG.getNode(ISD::SUB, getPointerTy(), RetAddrFI,
- DAG.getIntPtrConstant(4));
+ DAG.getIntPtrConstant(!Subtarget->is64Bit() ? 4 : 8));
}
SDOperand X86TargetLowering::LowerFRAME_TO_ARGS_OFFSET(SDOperand Op,
Added: llvm/branches/Apple/Gaz/test/CodeGen/X86/x86-64-frameaddr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Gaz/test/CodeGen/X86/x86-64-frameaddr.ll?rev=53479&view=auto
==============================================================================
--- llvm/branches/Apple/Gaz/test/CodeGen/X86/x86-64-frameaddr.ll (added)
+++ llvm/branches/Apple/Gaz/test/CodeGen/X86/x86-64-frameaddr.ll Fri Jul 11 17:36:20 2008
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llc -march=x86-64 | grep {leaq -8(%rsp), %rax}
+ at llvm.noinline = appending global [1 x i8*] [ i8* bitcast (i64* ()* @stack_end_address to i8*) ], section "llvm.metadata"
+
+define internal i64* @stack_end_address() nounwind {
+entry:
+ tail call i8* @llvm.frameaddress( i32 0 )
+ bitcast i8* %0 to i64*
+ ret i64* %1
+}
+
+declare i8* @llvm.frameaddress(i32) nounwind readnone
More information about the llvm-commits
mailing list