Commit 1032b06
committed
AMDGPU/MC: Try harder to evaluate absolute MC expressions
This is a follow-up to commit 24c8605 ("AMDGPU/MC: Fix emitting
absolute expressions (#136789)").
In some downstream work, we end up with an MCTargetExpr that is a
maximum (AGVK_Max) in an instruction operand. getMachineOpValueCommon
recognizes the absolute nature of the expression and doesn't emit a
fixup. getLitEncoding needs to be aligned with this decision, else we
end up with a 0 immediate without a corresponding fixup.
Note that evaluateAsAbsolute checks for MCConstantExpr as a fast path,
so this accepts strictly more cases than before.
I've tried several ways to write a test for this without success. The
challenge is that there is no upstream way to generate this kind of
expression in an instruction operand natively, and trying to create one
via inline assembly fails because the assembly parser evaluates the
expression to a constant during parsing.1 parent 7031280 commit 1032b06
1 file changed
+1
-5
lines changedLines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
258 | | - | |
259 | | - | |
| 258 | + | |
260 | 259 | | |
261 | | - | |
262 | | - | |
263 | 260 | | |
264 | | - | |
265 | 261 | | |
266 | 262 | | |
267 | 263 | | |
| |||
0 commit comments