[PATCH] D117957: [AVR] Remove unused register scavenger

Ben Shi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 23 08:04:21 PST 2022


benshi001 added inline comments.


================
Comment at: llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp:796
 
-  // Use a temporary register if src and dst registers are the same.
-  if (DstReg == SrcReg)
-    TmpReg = scavengeGPR8(MI);
-
-  Register CurDstLoReg = (DstReg == SrcReg) ? TmpReg : DstLoReg;
-  Register CurDstHiReg = (DstReg == SrcReg) ? TmpReg : DstHiReg;
+  assert(DstReg != SrcReg && "SrcReg and DstReg cannot be the same");
 
----------------
I did not understand how this assert is guranteed for LPM/ELPM.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117957/new/

https://reviews.llvm.org/D117957



More information about the llvm-commits mailing list