[PATCH] D14001: [Inliner] Don't inline through callsites with operand bundles

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 23 13:12:02 PDT 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL251141: [Inliner] Don't inline through callsites with operand bundles (authored by sanjoy).

Changed prior to commit:
  http://reviews.llvm.org/D14001?vs=38190&id=38254#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D14001

Files:
  llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
  llvm/trunk/test/Feature/OperandBundles/inliner-conservative.ll

Index: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
+++ llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
@@ -1029,6 +1029,10 @@
       CalledFunc->isDeclaration() || // call, or call to a vararg function!
       CalledFunc->getFunctionType()->isVarArg()) return false;
 
+  // The inliner does not know how to inline through calls with operand bundles.
+  if (CS.hasOperandBundles())
+    return false;
+
   // If the call to the callee cannot throw, set the 'nounwind' flag on any
   // calls that we inline.
   bool MarkNoUnwind = CS.doesNotThrow();
Index: llvm/trunk/test/Feature/OperandBundles/inliner-conservative.ll
===================================================================
--- llvm/trunk/test/Feature/OperandBundles/inliner-conservative.ll
+++ llvm/trunk/test/Feature/OperandBundles/inliner-conservative.ll
@@ -0,0 +1,17 @@
+; RUN: opt -S -inline < %s | FileCheck %s
+
+; Check that the inliner does not inline through arbitrary unknown
+; operand bundles.
+
+define i32 @callee() {
+ entry:
+  ret i32 2
+}
+
+define i32 @caller() {
+; CHECK: @caller(
+ entry:
+; CHECK: call i32 @callee() [ "unknown"() ]
+  %x = call i32 @callee() [ "unknown"() ]
+  ret i32 %x
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14001.38254.patch
Type: text/x-patch
Size: 1315 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151023/0c247f9d/attachment.bin>


More information about the llvm-commits mailing list