[PATCH] D110829: [X86] Copy registers in reverse order in convertToThreeAddress

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 4 09:48:24 PDT 2021


MatzeB accepted this revision.
MatzeB added a comment.
This revision is now accepted and ready to land.

Could you try if the suggested edits restore the `kill` flag in the test?

If yes then LGTM.



================
Comment at: llvm/lib/Target/X86/X86InstrInfo.cpp:1213
     NewSrc = SrcReg;
     isKill = Src.isKill();
     assert(!Src.isUndef() && "Undef op doesn't need optimization");
----------------
Can we use `MI.killsRegister(SrcReg);` here, so things work as expected in case of inconsistent kill-flags as discussed earlier?


================
Comment at: llvm/lib/Target/X86/X86InstrInfo.cpp:1228-1229
 
     NewSrc = getX86SubSuperRegister(Src.getReg(), 64);
     isKill = Src.isKill();
     assert(!Src.isUndef() && "Undef op doesn't need optimization");
----------------



================
Comment at: llvm/test/CodeGen/X86/twoaddr-mul2.ll:11
   ; CHECK-NEXT:   [[COPY:%[0-9]+]]:gr32 = COPY killed $edi
-  ; CHECK-NEXT:   undef %2.sub_32bit:gr64 = COPY killed [[COPY]]
-  ; CHECK-NEXT:   undef %3.sub_32bit:gr64_nosp = COPY [[COPY]]
-  ; CHECK-NEXT:   [[LEA64_32r:%[0-9]+]]:gr32 = LEA64_32r killed %2, 1, killed %3, 0, $noreg
+  ; CHECK-NEXT:   undef %2.sub_32bit:gr64_nosp = COPY [[COPY]]
+  ; CHECK-NEXT:   [[LEA64_32r:%[0-9]+]]:gr32 = LEA64_32r killed %2, 1, killed %2, 0, $noreg
----------------
Why isn't this `COPY killed [[COPY]]` anymore? Are we loosing a kill-flag now?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110829



More information about the llvm-commits mailing list