[llvm] [AMDGPU] Swap select operands to allow later v_cndmask shrinking into vop2 (PR #142354)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 9 05:28:58 PDT 2025
================
@@ -4727,7 +4732,33 @@ SDValue AMDGPUTargetLowering::performSelectCombine(SDNode *N,
SDValue True = N->getOperand(1);
SDValue False = N->getOperand(2);
- if (Cond.hasOneUse()) { // TODO: Look for multiple select uses.
+ int ShouldSwap = 0;
+ for (auto it = Cond->use_begin(); it != Cond->use_end(); it++) {
----------------
jayfoad wrote:
`it` should be capitalized, but really you should use a range-based for loop over `Cond->users()`.
https://github.com/llvm/llvm-project/pull/142354
More information about the llvm-commits
mailing list