[PATCH] D45116: Don't inline branch funnels

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 30 16:29:16 PDT 2018


vitalybuka created this revision.
vitalybuka added a reviewer: pcc.
Herald added a subscriber: hiraditya.

Inlined branch funnels fail expectation of LowerTypeTestsModule::lower()


Repository:
  rL LLVM

https://reviews.llvm.org/D45116

Files:
  llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
  llvm/test/Transforms/WholeProgramDevirt/branch-funnel.ll


Index: llvm/test/Transforms/WholeProgramDevirt/branch-funnel.ll
===================================================================
--- llvm/test/Transforms/WholeProgramDevirt/branch-funnel.ll
+++ llvm/test/Transforms/WholeProgramDevirt/branch-funnel.ll
@@ -140,7 +140,7 @@
 
 ; CHECK: define internal void @branch_funnel(i8* nest, ...)
 
-; CHECK: define hidden void @__typeid_typeid1_0_branch_funnel(i8* nest, ...)
+; CHECK: define hidden void @__typeid_typeid1_0_branch_funnel(i8* nest, ...) [[INLINE:#[0-3]+]]
 ; CHECK-NEXT: call void (...) @llvm.icall.branch.funnel(i8* %0, i8* bitcast ([1 x i8*]* @vt1_1 to i8*), i32 (i8*, i32)* @vf1_1, i8* bitcast ([1 x i8*]* @vt1_2 to i8*), i32 (i8*, i32)* @vf1_2, ...)
 
 declare i1 @llvm.type.test(i8*, metadata)
@@ -153,3 +153,4 @@
 !4 = distinct !{}
 
 attributes #0 = { "target-features"="+retpoline" }
+; CHECK: attributes [[INLINE]] = { noinline }
Index: llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
===================================================================
--- llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
+++ llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
@@ -846,6 +846,7 @@
     JT = Function::Create(FT, Function::InternalLinkage, "branch_funnel", &M);
   }
   JT->addAttribute(1, Attribute::Nest);
+  JT->addFnAttr(llvm::Attribute::NoInline);
 
   std::vector<Value *> JTArgs;
   JTArgs.push_back(JT->arg_begin());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45116.140507.patch
Type: text/x-patch
Size: 1384 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180330/e900f19d/attachment.bin>


More information about the llvm-commits mailing list