[PATCH] D104602: [InstCombine] Use poison constant to represent the result of unreachable instrs

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 19 23:02:38 PDT 2021


aqjune created this revision.
aqjune added reviewers: nikic, lebedev.ri, spatel, efriedma.
Herald added subscribers: jfb, hiraditya.
aqjune requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch updates InstCombine to use poison constant to represent the resulting value of (either semantically or syntactically) unreachable instrs.

This allows more aggressive folding of unused results, as shown in llvm/test/Transforms/InstCombine/getelementptr.ll .


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104602

Files:
  llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
  llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
  llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
  llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
  llvm/test/Transforms/GVN/PRE/2017-06-28-pre-load-dbgloc.ll
  llvm/test/Transforms/InstCombine/atomic.ll
  llvm/test/Transforms/InstCombine/builtin-object-size-ptr.ll
  llvm/test/Transforms/InstCombine/getelementptr.ll
  llvm/test/Transforms/InstCombine/load.ll
  llvm/test/Transforms/InstCombine/pr44245.ll
  llvm/test/Transforms/InstCombine/sadd-with-overflow.ll
  llvm/test/Transforms/InstCombine/ssub-with-overflow.ll
  llvm/test/Transforms/InstCombine/store.ll
  llvm/test/Transforms/InstCombine/uadd-with-overflow.ll
  llvm/test/Transforms/InstCombine/with_overflow.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104602.353222.patch
Type: text/x-patch
Size: 26191 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210620/d7999b56/attachment.bin>


More information about the llvm-commits mailing list