Index: lib/Transforms/Utils/InlineFunction.cpp =================================================================== --- lib/Transforms/Utils/InlineFunction.cpp +++ 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: test/Feature/OperandBundles/inliner-conservative.ll =================================================================== --- /dev/null +++ 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 +}