- 
                Notifications
    
You must be signed in to change notification settings  - Fork 15.1k
 
[WebAssembly,llvm] Add llvm.wasm.ref.test.func intrinsic #147486
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
          
     Merged
      
      
    
  
     Merged
                    Changes from 2 commits
      Commits
    
    
            Show all changes
          
          
            22 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      5eb65fd
              
                [WebAssembly,llvm] Add llvm.wasm.ref.test.func intrinsic, option 2
              
              
                hoodmane ce05ea5
              
                Use bit width to decide whether to emit CImm or Imm
              
              
                hoodmane f049ff6
              
                Try moving to WebAssemblyISelDAGToDAG
              
              
                hoodmane a6582c5
              
                Revert some unneeded changes
              
              
                hoodmane 1335a04
              
                Tidy up
              
              
                hoodmane aff1350
              
                Fix and cleanup
              
              
                hoodmane ec77465
              
                Separate test cases into their own functions
              
              
                hoodmane e32bb0b
              
                Cleanup
              
              
                hoodmane 6562073
              
                try using an Imm if getSignificantBits() < 64
              
              
                hoodmane c4e921a
              
                Fix handling of void functions
              
              
                hoodmane 2df9ffc
              
                Apply suggestions from code review
              
              
                hoodmane 802cae7
              
                Convert diagnostic back to unreachable
              
              
                hoodmane 1fa1772
              
                Add comment that words are 64 bits
              
              
                hoodmane e8a0ee1
              
                More idiomatic assertions
              
              
                hoodmane d8af945
              
                Generate assertions with utils/update_llc_test_checks.py
              
              
                hoodmane e8845c9
              
                Fix
              
              
                hoodmane 2dacd98
              
                Fix swapped params and returns
              
              
                hoodmane 6ad6d2c
              
                Support multiple return values
              
              
                hoodmane a9d9420
              
                llvm style for loop bound
              
              
                hoodmane 781d7ae
              
                Add comment explaining operand magic number
              
              
                hoodmane 57c7be8
              
                Test against wasm64 too
              
              
                hoodmane 0330a8b
              
                clang-format
              
              
                hoodmane 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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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,42 @@ | ||
| ; RUN: llc < %s -mcpu=mvp -mattr=+reference-types | FileCheck %s | ||
                
      
                  hoodmane marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| target triple = "wasm32-unknown-unknown" | ||
| 
     | 
||
| ; CHECK-LABEL: test_function_pointer_signature_void: | ||
| ; CHECK-NEXT: .functype test_function_pointer_signature_void (i32) -> () | ||
| ; CHECK-NEXT: .local funcref | ||
| ; CHECK: local.get 0 | ||
| ; CHECK-NEXT: table.get __indirect_function_table | ||
| ; CHECK-NEXT: local.tee 1 | ||
| ; CHECK-NEXT: ref.test (f32, f64, i32) -> (f32) | ||
| ; CHECK-NEXT: call use | ||
| ; CHECK-NEXT: local.get 1 | ||
| ; CHECK-NEXT: ref.test (f32, f64, i32) -> (i32) | ||
| ; CHECK-NEXT: call use | ||
| ; CHECK-NEXT: local.get 1 | ||
| ; CHECK-NEXT: ref.test (i32, i32, i32) -> (i32) | ||
| ; CHECK-NEXT: call use | ||
| ; CHECK-NEXT: local.get 1 | ||
| ; CHECK-NEXT: ref.test (i32, i32, i32) -> () | ||
| ; CHECK-NEXT: call use | ||
| ; CHECK-NEXT: local.get 1 | ||
| ; CHECK-NEXT: ref.test () -> () | ||
| ; CHECK-NEXT: call use | ||
| 
     | 
||
| ; Function Attrs: nounwind | ||
| define void @test_function_pointer_signature_void(ptr noundef %func) local_unnamed_addr #0 { | ||
| entry: | ||
| %0 = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, float 0.000000e+00, float 0.000000e+00, double 0.000000e+00, i32 0) | ||
                
      
                  hoodmane marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| tail call void @use(i32 noundef %0) #3 | ||
| %1 = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, i32 0, float 0.000000e+00, double 0.000000e+00, i32 0) | ||
| tail call void @use(i32 noundef %1) #3 | ||
| %2 = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, i32 0, i32 0, i32 0, i32 0) | ||
| tail call void @use(i32 noundef %2) #3 | ||
| %3 = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, token poison, i32 0, i32 0, i32 0) | ||
| tail call void @use(i32 noundef %3) #3 | ||
| %4 = tail call i32 (ptr, ...) @llvm.wasm.ref.test.func(ptr %func, token poison) | ||
| tail call void @use(i32 noundef %4) #3 | ||
| ret void | ||
| } | ||
| 
     | 
||
| declare void @use(i32 noundef) local_unnamed_addr #1 | ||
      
      Oops, something went wrong.
        
    
  
  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.