Currently, the truncate selection dag node is expanded as a bitwise AND plus compare to 1. This change enables scalar comparison in the pattern if the truncate node is uniform.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/AMDGPU/SIInstructions.td | ||
---|---|---|
2112 | I think we can later fold it into s_bitcmp1_b32 $a, 0 |
llvm/lib/Target/AMDGPU/SIInstructions.td | ||
---|---|---|
2112 | For now, I would prefer to leave TODO here. Any objections? |
llvm/lib/Target/AMDGPU/SIInstructions.td | ||
---|---|---|
2112 | No objections, I also do not think we have to select it this way, but rather combine later. |
llvm/lib/Target/AMDGPU/SIInstructions.td | ||
---|---|---|
2112 | What's interesting, S_AND_B32 will produce SCC = 1 on non-zero result just by itself! When you land it we may experiment with removing S_CMP from this pattern completely, although I am not sure how the rest of the BE prepared for the lack of compare and what would the pattern after propagating SCC from moveToVALU(). |
I think we can later fold it into