[PATCH] D103073: [LTT] Handle merged llvm.assume when dropping type tests

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 24 22:06:55 PDT 2021


tejohnson created this revision.
tejohnson added reviewers: pcc, evgeny777.
Herald added a subscriber: hiraditya.
tejohnson requested review of this revision.
Herald added a project: LLVM.

When the lower type test pass is invoked a second time with
DropTypeTests set to true, it expects that all remaining type tests feed
assume instructions, which are removed along with the type tests.

In some cases the llvm.assume might have been merged with another one,
i.e. from a builtin_assume instruction, in which case the type test
would actually feed a phi that in turn feeds the merged assume
instruction. In this case we can simply replace that operand of the phi
with "true" before removing the type test.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103073

Files:
  llvm/lib/Transforms/IPO/LowerTypeTests.cpp
  llvm/test/Transforms/LowerTypeTests/drop_type_test_phi.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103073.347579.patch
Type: text/x-patch
Size: 4734 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210525/c5c0ced1/attachment.bin>


More information about the llvm-commits mailing list