[PATCH] D116270: [AMDGPU] Enable divergence-driven XNOR selection
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 10 07:45:54 PST 2022
foad added a comment.
In D116270#3231609 <https://reviews.llvm.org/D116270#3231609>, @alex-t wrote:
> Now:
>
> We select the divergent NOT to V_NOT_B32_e32 and divergent XOR to V_XOR_B32_e64. The selection is correct but we missed the opportunity to exploit the fact that even divergent NOT may be selected to S_NOT_B32 w/o the correctness lost.
No, you cannot correctly select divergent NOT to S_NOT_B32. That is not what was happening before your patch (see https://reviews.llvm.org/D116270?vs=on&id=396159#change-5HrmrjqhUdXJ). What was happening was that an input like `~(uniform ^ divergent)` was being "reassociated" to `~uniform ^ divergent` so it could be correctly selected to S_NOT + V_XOR. I assume this was done with a very clever selection pattern, but I am suggesting that instead of that you could implement it as a DAG combine (to do the reassociation), so there is no need for clever selection patterns.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116270/new/
https://reviews.llvm.org/D116270
More information about the llvm-commits
mailing list