[llvm] peephole-opt: Fold uses of REG_SEQUENCE subregisters (WIP) (PR #161225)

Frederik Harwath via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 30 06:53:20 PDT 2025


================
@@ -220,6 +220,58 @@ class CopyRewriter : public Rewriter {
   }
 };
 
+/// Rewriter for REG_SEQUENCE source operands.  This class is used for
+/// rewriting uses of REG_SEQUENCE operands in arbitrary instructions
+/// whereas the RegSequenceRewriter is used for rewriting REG_SEQUENCE
+/// instructions.
----------------
frederik-h wrote:

> I'm looking at a similar problem now, and I think there's just a deeper bug in subregister tracking in ValueTracker. I don't think there needs to be a dedicated fold into users of reg_sequences

You mean that we do want the fold to occur but we would not need to implement a dedicated optimization for this once something in the ValueTracker is fixed, right? But I do not see which optimization in the pass would carry out this kind of fold - regardless of what the ValueTracker does.

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


More information about the llvm-commits mailing list