To compute the size of a VALU/SALU instruction, we need to check whether an operand could ever be literal.
Previously isLiteralConstant was used, which missed cases like global variables or external symbols. These misses lead to under-estimation of the instruction size and branch offset, and thus incorrectly skip the necessary branch relaxation when the branch offset is actually greater than what the branch bits can hold.
In this work, we use isLiteralConstantLike to check the operands. It maybe conservative, but it is safe.
Details
Details
- Reviewers
arsenm bcahoon - Group Reviewers
Restricted Project - Commits
- rG1711020c3769: AMDGPU: Use isLiteralConstantLike to check whether the operand could ever be…
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo