[PATCH] D62342: [SelectionDAG] Enhance the simplification of `copyto` from `implicit-def`.

Michael Liao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 23 13:45:16 PDT 2019


hliao created this revision.
hliao added reviewers: sunfish, nhaehnle.
Herald added subscribers: llvm-commits, asbirlea, hiraditya, jvesely.
Herald added a project: LLVM.

- The current implementation simplifies the case where the source of `copyto` is `implicit-def`ed. However, it only works when that `implicit-def` is single-used since it detects that from `implicit-def` and cannot determine which destination vreg should be used if there are multiple uses.
- This patch changes that detection when `copyto` is being emitted. If that `copyto`'s source is defined from `implicit-def`, it simplifies it. Hence, it works even that `implicit-def` is multi-used.
- Except it simplifies the internal IR, it won't improve the quality of code generation. However, it helps to detect 'implicit-def` in a straight-forward manner in some passes, such as `si-i1-copies`. A test case is added.
- Another test is slightly changed due to the simplified instructions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D62342

Files:
  llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
  llvm/lib/CodeGen/SelectionDAG/InstrEmitter.h
  llvm/test/CodeGen/AMDGPU/i1-copy-phi.ll
  llvm/test/CodeGen/X86/2009-02-26-MachineLICMBug.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62342.201055.patch
Type: text/x-patch
Size: 5734 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190523/e58cd68c/attachment.bin>


More information about the llvm-commits mailing list