Whenever a v_cmp, s_and_saveexec instruction sequence shall be
transformed to an equivalent s_mov, v_cmpx sequence, it needs
to be detected if the v_cmp target register is used between
the two instructions as the v_cmp result gets omitted by
using the v_cmpx instruction, resulting in invalid code.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Looks OK as it fixes a bug, but I think the liveness checking could be cleaned up as noted inline.
llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp | ||
---|---|---|
414–422 | I'm not sure that the isRegisterInUseBetween and isRegisterInUseAfter helper functions are actually making this code any simpler, or easier to understand. The conditions you really want to check are:
|
I'm not sure that the isRegisterInUseBetween and isRegisterInUseAfter helper functions are actually making this code any simpler, or easier to understand.
The conditions you really want to check are: