mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-11-04 05:17:07 +00:00 
			
		
		
		
	This patch allows the read_register and write_register intrinsics to read/write the RBP/EBP registers on X86 iff the targeted register is the frame pointer for the containing function. Differential Revision: http://reviews.llvm.org/D10977 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241827 91177308-0d34-0410-b5e6-96231b3b80d8
		
			
				
	
	
		
			13 lines
		
	
	
		
			326 B
		
	
	
	
		
			LLVM
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			326 B
		
	
	
	
		
			LLVM
		
	
	
	
	
	
; RUN: not llc < %s -mtriple=x86_64-linux-gnueabi 2>&1 | FileCheck %s
 | 
						|
 | 
						|
define i32 @get_frame() nounwind {
 | 
						|
entry:
 | 
						|
; CHECK: register ebp is allocatable: function has no frame pointer
 | 
						|
  %fp = call i32 @llvm.read_register.i32(metadata !0)
 | 
						|
  ret i32 %fp
 | 
						|
}
 | 
						|
 | 
						|
declare i32 @llvm.read_register.i32(metadata) nounwind
 | 
						|
 | 
						|
!0 = !{!"ebp\00"}
 |