Extend pre-emit peephole for S_CBRANCH_VCC[N]Z to eliminate
redundant S_AND operations against EXEC for V_CMP results in VCC.
These occur after after register allocation when VCC has been
selected as the comparison destination.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Can you add some MIR tests, plus add a test for V_CMP_CLASS where this should also work
Comment Actions
Extend pre-emit peephole for S_CBRANCH_VCC[N]Z to eliminate
redundant S_AND operations against EXEC for V_CMP results in VCC.
No particular objection to this patch, but it would be nice to do this more generally for comparison results that are not in vcc too.
llvm/lib/Target/AMDGPU/SIPreEmitPeephole.cpp | ||
---|---|---|
148 | I think isCompare is always redundant with isVOPC |
llvm/lib/Target/AMDGPU/SIPreEmitPeephole.cpp | ||
---|---|---|
148 | Switched to using only isVOPC and documented why in a comment. |
llvm/lib/Target/AMDGPU/SIPreEmitPeephole.cpp | ||
---|---|---|
149 | isVOPC is redundant with isVALU |
I think isCompare is always redundant with isVOPC