Commit d747677
committed
[CostModel] Remove optional from InstructionCost::getValue()
InstructionCost is already an optional value, containing an Invalid state that
can be checked with isValid(). There is little point in returning another
optional from getValue(). Most uses do not make use of it being a
std::optional, dereferencing the value directly (either isValid has been
checked previously or the Cost is assumed to be valid). The one case that does
in AMDGPU used value_or which has been replaced by a new getValueOr(CostType)
function.1 parent 2ba455f commit d747677
File tree
22 files changed
+52
-51
lines changed- llvm
- include/llvm
- CodeGen
- Support
- Transforms/Utils
- lib
- Analysis
- CodeGen
- Target
- AArch64
- AMDGPU
- PowerPC
- RISCV
- SystemZ
- X86
- Transforms
- IPO
- Scalar
- Vectorize
- unittests/Support
22 files changed
+52
-51
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1609 | 1609 | | |
1610 | 1610 | | |
1611 | 1611 | | |
1612 | | - | |
| 1612 | + | |
1613 | 1613 | | |
1614 | 1614 | | |
1615 | 1615 | | |
| |||
2877 | 2877 | | |
2878 | 2878 | | |
2879 | 2879 | | |
2880 | | - | |
| 2880 | + | |
2881 | 2881 | | |
2882 | 2882 | | |
2883 | 2883 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
84 | 83 | | |
85 | 84 | | |
86 | 85 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
| 131 | + | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| |||
1380 | 1380 | | |
1381 | 1381 | | |
1382 | 1382 | | |
1383 | | - | |
1384 | | - | |
| 1383 | + | |
| 1384 | + | |
1385 | 1385 | | |
1386 | 1386 | | |
1387 | 1387 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28530 | 28530 | | |
28531 | 28531 | | |
28532 | 28532 | | |
28533 | | - | |
| 28533 | + | |
28534 | 28534 | | |
28535 | 28535 | | |
28536 | 28536 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4596 | 4596 | | |
4597 | 4597 | | |
4598 | 4598 | | |
4599 | | - | |
| 4599 | + | |
4600 | 4600 | | |
4601 | 4601 | | |
4602 | 4602 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
209 | | - | |
| 208 | + | |
210 | 209 | | |
211 | 210 | | |
212 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1278 | 1278 | | |
1279 | 1279 | | |
1280 | 1280 | | |
1281 | | - | |
| 1281 | + | |
1282 | 1282 | | |
1283 | | - | |
| 1283 | + | |
1284 | 1284 | | |
1285 | 1285 | | |
1286 | 1286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1100 | 1100 | | |
1101 | 1101 | | |
1102 | 1102 | | |
1103 | | - | |
| 1103 | + | |
1104 | 1104 | | |
1105 | 1105 | | |
1106 | 1106 | | |
| |||
0 commit comments