[llvm] [AMDGPU] Delete redundant s_or_b32 (PR #165261)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 31 07:48:32 PDT 2025
================
@@ -10628,7 +10628,31 @@ bool SIInstrInfo::optimizeCompareInstr(MachineInstr &CmpInstr, Register SrcReg,
if (SrcReg2 && !getFoldableImm(SrcReg2, *MRI, CmpValue))
return false;
- const auto optimizeCmpSelect = [&CmpInstr, SrcReg, CmpValue, MRI,
+ // SCC is already valid after SCCValid.
+ // SCCRedefine will redefine SCC to the same value already available after
+ // SCCValid. If there are no intervening SCC conflicts delete SCCRedefine and
+ // update kill/dead flags if necessary.
+ const auto optimizeSCC = [this](MachineInstr *SCCValid,
----------------
LU-JOHN wrote:
> Would it be better to move `optimizeSCC` to a method? It's not accessing its surrounding context besides `this`.
optimizeSCC moved to NFC PR https://github.com/llvm/llvm-project/pull/165871. Discuss method vs. lambda there.
https://github.com/llvm/llvm-project/pull/165261
More information about the llvm-commits
mailing list