- 
                Notifications
    
You must be signed in to change notification settings  - Fork 15.1k
 
             [Clang] Add __builtin_stack_address
          #148281
        
          New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Open
      
      
            moorabbit
  wants to merge
  23
  commits into
  llvm:main
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
moorabbit:gcc-builtin-stack-address
  
      
      
   
  
    
  
  
  
 
  
      
    base: main
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Open
                    Changes from 1 commit
      Commits
    
    
            Show all changes
          
          
            23 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      029d9fc
              
                [Clang] Add `__builtin_stack_address`
              
              
                moorabbit 0b5e0ed
              
                [LLVM] Document 'llvm.stackaddress' Intrinsic
              
              
                moorabbit 2b8084a
              
                [LLVM] Correct minor typo in a comment
              
              
                moorabbit 020909e
              
                [LLVM] Change SelectionDAG Opcode name
              
              
                moorabbit 88db438
              
                [Clang] Refactor test case
              
              
                moorabbit 0669180
              
                [Clang] Code formatting
              
              
                moorabbit aea6944
              
                Merge branch 'main' into gcc-builtin-stack-address
              
              
                moorabbit 20d0259
              
                Disable custom lowering of STACKADDRESS on x86
              
              
                moorabbit da68490
              
                Expand STACKADDRESS to STACKSAVE by default
              
              
                moorabbit 6cdcf58
              
                Custom lowering of STACKADDRESS on Sparc
              
              
                moorabbit c56be28
              
                Remove Target check from Sema
              
              
                moorabbit 1ed8a5d
              
                clang-format
              
              
                moorabbit 1339b31
              
                refactor test cases
              
              
                moorabbit 64eb4ad
              
                AaronBallman's suggestion
              
              
                moorabbit 7c38381
              
                Fix windows CI failure
              
              
                moorabbit d47cb56
              
                efriedma-quic's comment
              
              
                moorabbit 1ba60ce
              
                Fix note
              
              
                moorabbit 4f1fad5
              
                move aarch64 test under llvm/test/CodeGen/aarch64/
              
              
                moorabbit 6ced7f8
              
                nikic's suggestions
              
              
                moorabbit fdb520a
              
                re-format clang docs
              
              
                moorabbit 1f77682
              
                nikic's suggestion
              
              
                moorabbit 57e9fe5
              
                arsenm's comment
              
              
                moorabbit ae3b2b6
              
                arsenm's comment
              
              
                moorabbit File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| ; RUN: llc < %s -mtriple=armv7 | FileCheck %s --check-prefix=armv7 | ||
| ; RUN: llc < %s -mtriple=aarch64 | FileCheck %s --check-prefix=aarch64 | ||
                
      
                  moorabbit marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| declare ptr @llvm.stackaddress.p0() | ||
| 
     | 
||
| define ptr @test() { | ||
| ; armv7: mov r0, sp | ||
| ; armv7: bx lr | ||
| 
     | 
||
| ; aarch64: mov x0, sp | ||
| ; aarch64: ret | ||
| %sp = call ptr @llvm.stackaddress.p0() | ||
| ret ptr %sp | ||
| } | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| ; RUN: llc < %s -mtriple=x86_64-linux-gnu -o - | FileCheck --check-prefix=x86_64 %s | ||
| ; RUN: llc < %s -mtriple=i386-linux-gnu -o - | FileCheck --check-prefix=i386 %s | ||
| 
     | 
||
| declare ptr @llvm.stackaddress.p0() | ||
| 
     | 
||
| define ptr @test() { | ||
| ; x86_64: movq %rsp, %rax | ||
| ; x86_64: retq | ||
| 
     | 
||
| ; i386: movl %esp, %eax | ||
| ; i386: retl | ||
| %sp = call ptr @llvm.stackaddress.p0() | ||
| ret ptr %sp | ||
| } | 
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.