[PATCH] D122533: [AVR] Remove AVRRelaxMemOperations

Ben Shi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 27 05:11:27 PDT 2022


benshi001 added inline comments.


================
Comment at: llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp:1174
 
-  auto MIBLO = buildMI(MBB, MBBI, OpLo)
-                   .addReg(DstReg)
-                   .addImm(Imm)
-                   .addReg(SrcLoReg, getKillRegState(SrcIsKill));
+    buildMI(MBB, MBBI, AVR::SBCIWRdK)
+        .addReg(DstReg, RegState::Define)
----------------
Patryk27 wrote:
> benshi001 wrote:
> > The above built error is caused by this line, this should be a SUBI other than a SBCI.
> Out of curiosity, why SUBI? (just trying to understand what is the difference between both)
> 
> It looks like currently - https://github.com/llvm/llvm-project/blob/d9cea8d3a8fff86672174780312674871729578c/llvm/lib/Target/AVR/AVRRelaxMemOperations.cpp#L101 - we expand to SBCI.
I thought this should be an old bug which has never been triggered. Actually if C bit in SREG is set before current `STWPtrPdRr`, then it is sure to run into  wrong.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122533



More information about the llvm-commits mailing list