[llvm] [AMDGPU] Prevent cyclic behaviour in SIFoldOperands (PR #82099)

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 18 23:42:50 PST 2024


================
@@ -783,6 +784,10 @@ void SIFoldOperands::foldOperand(
       if (RSUse.getSubReg() != RegSeqDstSubReg)
         continue;
 
+      if (seenMI.count(RSUseMI) != 0)
----------------
Pierre-vh wrote:

If using `DenseSet` this just becomes `contains(RSUseMI)`


https://github.com/llvm/llvm-project/pull/82099


More information about the llvm-commits mailing list