[PATCH] D141740: [IRLinker] Replace CallInstr with CallBase

Gulfem Savrun Yeniceri via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 10:28:59 PST 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG117ecdd5789e: [IRLinker] Replace CallInstr with CallBase (authored by gulfem).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141740/new/

https://reviews.llvm.org/D141740

Files:
  llvm/lib/Linker/IRMover.cpp
  llvm/test/Linker/drop-attribute.ll


Index: llvm/test/Linker/drop-attribute.ll
===================================================================
--- llvm/test/Linker/drop-attribute.ll
+++ llvm/test/Linker/drop-attribute.ll
@@ -5,18 +5,26 @@
 ; CHECK: define i32 @main()
 ; CHECK-NEXT: entry:
 ; CHECK-NEXT: call void @test_nocallback_definition()
-; Test that checks that nocallback attribute on a call-site is dropped.
+; Test that checks that nocallback attribute on a call-site in a call instruction is dropped.
 ; CHECK-NEXT: call void @test_nocallback_call_site(){{$}}
 ; CHECK-NEXT: %0 = call float @llvm.sqrt.f32(float undef)
 ; CHECK-NEXT: call void @test_nocallback_declaration_definition_not_linked_in()
 ; CHECK-NEXT: call void @test_nocallback_declaration_definition_linked_in()
-define i32 @main() {
+; Test that checks that nocallback attribute on a call-site in an invoke instruction is dropped.
+; CHECK-NEXT: invoke void @test_nocallback_call_site(){{$}}
+define i32 @main() personality i8 0 {
 entry:
   call void @test_nocallback_definition()
   call void @test_nocallback_call_site() nocallback
   call float @llvm.sqrt.f32(float undef)
   call void @test_nocallback_declaration_definition_not_linked_in()
   call void @test_nocallback_declaration_definition_linked_in()
+  invoke void @test_nocallback_call_site() nocallback
+          to label %ret unwind label %unw
+unw:
+  %tmp = landingpad i8 cleanup
+  br label %ret
+ret:
   ret i32 0
 }
 
@@ -26,7 +34,7 @@
   ret void
 }
 
-; Test that checks that nocallback attribute on a declaration when a definition is linked in is dropped.
+; Test that checks that nocallback attribute on a call site is dropped.
 ; CHECK: declare void @test_nocallback_call_site(){{$}}
 declare void @test_nocallback_call_site()
 
Index: llvm/lib/Linker/IRMover.cpp
===================================================================
--- llvm/lib/Linker/IRMover.cpp
+++ llvm/lib/Linker/IRMover.cpp
@@ -1555,7 +1555,7 @@
     // Remove nocallback attribute when it is on a call-site.
     for (BasicBlock &BB : *F)
       for (Instruction &I : BB)
-        if (CallInst *CI = dyn_cast<CallInst>(&I))
+        if (CallBase *CI = dyn_cast<CallBase>(&I))
           CI->removeFnAttr(Attribute::NoCallback);
   }
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141740.490587.patch
Type: text/x-patch
Size: 2229 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230119/5637e545/attachment.bin>


More information about the llvm-commits mailing list