[PATCH] D59633: [PowerPC] Look through copies for compare elimination

Jinsong Ji via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 14:02:31 PDT 2019


jsji requested changes to this revision.
jsji added a comment.
This revision now requires changes to proceed.

Might miss some opportunity related to parameters instead. Please have a look. Thanks.



================
Comment at: lib/Target/PowerPC/PPCInstrInfo.cpp:1669
   // Get the unique definition of SrcReg.
+  SrcReg = TRI->lookThruCopyLike(SrcReg, MRI);
   MachineInstr *MI = MRI->getUniqueVRegDef(SrcReg);
----------------
This will have some problem with parameter/return COPY:  We will get HW reg instead, wrong `MI`, then mess up the search scope in line 1802 later.
See `test/CodeGen/PowerPC/optcmp.ll` for an example.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D59633





More information about the llvm-commits mailing list