Commit 3076a68
[RISCV] [MachineOutliner] Analyze all candidates (llvm#127659)
llvm#117700 made a change from analyzing all the candidates to analyzing
just the first candidate before deciding to either delete or keep all of
them.
Even though the candidates all have the same instructions, the basic
blocks in which they are present are different and we will need to check
each of them before deciding whether to keep or erase them.
Particularly, `isAvailableAcrossAndOutOfSeq` checks to see if the
register (x5 in this case) is available from the end of the MBB to the
beginning of the candidate and not checking this for each candidate led
to incorrect candidates being outlined resulting in correctness issues
in a few downstream benchmarks.
Similarly, deleting all the candidates if the first one is not viable
will result in missed outlining opportunities.
(cherry picked from commit 6757cf4)1 parent deb63e7 commit 3076a68
File tree
2 files changed
+158
-30
lines changed- llvm
- lib/Target/RISCV
- test/CodeGen/RISCV
2 files changed
+158
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3010 | 3010 | | |
3011 | 3011 | | |
3012 | 3012 | | |
3013 | | - | |
3014 | | - | |
| 3013 | + | |
3015 | 3014 | | |
3016 | 3015 | | |
3017 | 3016 | | |
3018 | 3017 | | |
3019 | 3018 | | |
3020 | 3019 | | |
3021 | | - | |
| 3020 | + | |
3022 | 3021 | | |
3023 | 3022 | | |
3024 | | - | |
3025 | | - | |
3026 | | - | |
3027 | | - | |
3028 | | - | |
3029 | | - | |
3030 | | - | |
3031 | | - | |
3032 | | - | |
3033 | | - | |
3034 | | - | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
| 3029 | + | |
3035 | 3030 | | |
3036 | | - | |
| 3031 | + | |
3037 | 3032 | | |
3038 | 3033 | | |
3039 | 3034 | | |
| |||
3042 | 3037 | | |
3043 | 3038 | | |
3044 | 3039 | | |
3045 | | - | |
3046 | | - | |
3047 | | - | |
3048 | | - | |
3049 | | - | |
| 3040 | + | |
| 3041 | + | |
3050 | 3042 | | |
3051 | 3043 | | |
3052 | 3044 | | |
3053 | 3045 | | |
3054 | 3046 | | |
| 3047 | + | |
| 3048 | + | |
3055 | 3049 | | |
3056 | 3050 | | |
3057 | 3051 | | |
3058 | 3052 | | |
3059 | 3053 | | |
3060 | | - | |
3061 | | - | |
3062 | | - | |
3063 | | - | |
3064 | | - | |
3065 | | - | |
3066 | | - | |
3067 | | - | |
3068 | | - | |
| 3054 | + | |
| 3055 | + | |
| 3056 | + | |
3069 | 3057 | | |
3070 | 3058 | | |
3071 | 3059 | | |
3072 | 3060 | | |
3073 | | - | |
| 3061 | + | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
| 3065 | + | |
3074 | 3066 | | |
3075 | 3067 | | |
3076 | 3068 | | |
| |||
Lines changed: 136 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 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
0 commit comments