[PATCH] D42622: [AggressiveInstCombine] fixed PR36121

Amjad Aboud via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 28 07:18:02 PST 2018


aaboud created this revision.
aaboud added reviewers: craig.topper, spatel.

Fixed the handle of trunc instruction as a leaf for expression pattern dominated by another trunc instruction.
In this case we need to update the work list of trunc instructions as follows:

1. Replace old-trunc instruction node with the new-trunc instruction, if we reduced trunc instruction to different trunc instruction.
2. Remove old-trunc instruction node from work-list, if we reduced trunc instruction to non-trunc instruction (e.g., to a constant expression).
3. Add new-trunc instruction node to work-list, if we reduced a non-trunc instruction (e.g., zext/sext) into trunc instruction.

This should solve PR36121 <https://bugs.llvm.org/show_bug.cgi?id=36121>.


https://reviews.llvm.org/D42622

Files:
  lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp
  test/Transforms/AggressiveInstCombine/trunc_const_expr.ll
  test/Transforms/AggressiveInstCombine/trunc_multi_uses.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42622.131706.patch
Type: text/x-patch
Size: 5660 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180128/32981cab/attachment.bin>


More information about the llvm-commits mailing list