[PATCH] D111857: 【TwoAddressInstructionPass】 Put all new instructions into DistanceMap

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 14 17:41:32 PDT 2021


Carrot created this revision.
Carrot added reviewers: craig.topper, pengfei, RKSimon, stoklund.
Herald added subscribers: mstorsjo, hiraditya.
Carrot requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

In function convertInstTo3Addr, after converting a two address instruction into three address instruction, only the last new instruction is inserted into DistanceMap. This is wrong, DistanceMap should track all instructions from the beginning of current MBB to the working instruction. When a two address instruction is converted to three address instruction, multiple instructions may be generated (usually an extra COPY is generated), all of them should be inserted into DistanceMap.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111857

Files:
  llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
  llvm/test/CodeGen/X86/addcarry.ll
  llvm/test/CodeGen/X86/sadd_sat_plus.ll
  llvm/test/CodeGen/X86/sadd_sat_vec.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111857.379893.patch
Type: text/x-patch
Size: 5235 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211015/507f90dd/attachment.bin>


More information about the llvm-commits mailing list