llvm-project
d58b0f23 - AMDGPU/MC: Try harder to evaluate absolute MC expressions (#145146)

Commit
302 days ago
AMDGPU/MC: Try harder to evaluate absolute MC expressions (#145146) This is a follow-up to commit 24c860547e8 ("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.
Author
Parents
Loading