Commit d6f994a
committed
[InlineCost] Check for conflicting target attributes early
When we inline a callee into a caller, the compiler needs to make sure
that the caller supports a superset of instruction sets that the
callee is allowed to use. Normally, we check for the compatibility of
target features via functionsHaveCompatibleAttributes, but that
happens after we decide to honor call site attribute
Attribute::AlwaysInline. If the caller contains a call marked with
Attribute::AlwaysInline, which can happen with
__attribute__((flatten)) placed on the caller, the caller could end up
with code that cannot be lowered to assembly code.
This patch fixes the problem by checking the target feature
compatibility before we honor Attribute::AlwaysInline.
Fixes #62664
Differential Revision: https://reviews.llvm.org/D1503961 parent 14c44df commit d6f994a
File tree
2 files changed
+50
-6
lines changed- llvm
- lib/Analysis
- test/Transforms/Inline
2 files changed
+50
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2801 | 2801 | | |
2802 | 2802 | | |
2803 | 2803 | | |
2804 | | - | |
| 2804 | + | |
2805 | 2805 | | |
2806 | 2806 | | |
2807 | 2807 | | |
2808 | 2808 | | |
2809 | 2809 | | |
2810 | 2810 | | |
2811 | | - | |
2812 | | - | |
2813 | | - | |
| 2811 | + | |
2814 | 2812 | | |
2815 | 2813 | | |
2816 | 2814 | | |
| |||
2926 | 2924 | | |
2927 | 2925 | | |
2928 | 2926 | | |
| 2927 | + | |
| 2928 | + | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
| 2932 | + | |
2929 | 2933 | | |
2930 | 2934 | | |
2931 | 2935 | | |
| |||
2940 | 2944 | | |
2941 | 2945 | | |
2942 | 2946 | | |
2943 | | - | |
2944 | | - | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
2945 | 2953 | | |
2946 | 2954 | | |
2947 | 2955 | | |
| |||
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
0 commit comments