Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AlwaysInliner] Check inliner errors even without assserts
When we build clang without asserts we should still check the result of `InlineFunction()` to be sure there wasn't an error. Otherwise we could incorrectly merge attributes in the next line. This also removes a redundent call to `getCaller()`. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D121722
- Loading branch information
Showing
2 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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 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,20 @@ | ||
; RUN: opt -passes="always-inline" -pass-remarks-missed=inline -S < %s 2>&1 | FileCheck %s | ||
|
||
declare void @personalityFn1(); | ||
declare void @personalityFn2(); | ||
|
||
define void @foo() alwaysinline { | ||
ret void | ||
} | ||
|
||
define void @bar() alwaysinline personality void ()* @personalityFn1 { | ||
ret void | ||
} | ||
|
||
define void @goo() personality void ()* @personalityFn2 { | ||
; CHECK-DAG: 'bar' is not inlined into 'goo': incompatible personality | ||
call void @bar() | ||
; CHECK-DAG: 'foo' is not inlined into 'goo': unsupported operand bundle | ||
call void @foo() [ "CUSTOM_OPERAND_BUNDLE"() ] | ||
ret void | ||
} |