[llvm-branch-commits] [llvm] [AMDGPU][MC] Replace shifted registers in CFI instructions (PR #164726)
Matt Arsenault via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sat Feb 7 06:54:17 PST 2026
================
@@ -1292,6 +1292,39 @@ void MCGenDwarfLabelEntry::Make(MCSymbol *Symbol, MCStreamer *MCOS,
MCGenDwarfLabelEntry(Name, FileNumber, LineNumber, Label));
}
+void MCCFIInstruction::replaceRegister(unsigned FromReg, unsigned ToReg) {
+ auto ReplaceReg = [=](unsigned &Reg) {
+ if (Reg == FromReg)
+ Reg = ToReg;
+ };
+ auto Visitor = makeVisitor(
+ [=](CommonFields &F) {
+ ReplaceReg(F.Register);
+ ReplaceReg(F.Register2);
+ },
+ [](EscapeFields &) {}, [](LabelFields &) {},
+ [=](RegisterPairFields &F) {
+ ReplaceReg(F.Register);
+ ReplaceReg(F.Reg1);
+ ReplaceReg(F.Reg2);
+ },
+ [=](VectorRegistersFields &F) {
+ ReplaceReg(F.Register);
+ for (auto &VRL : F.VectorRegisters)
----------------
arsenm wrote:
no auto
https://github.com/llvm/llvm-project/pull/164726
More information about the llvm-branch-commits
mailing list