diff options
author | Max Kazantsev <max.kazantsev@azul.com> | 2018-06-19 04:48:34 +0000 |
---|---|---|
committer | Max Kazantsev <max.kazantsev@azul.com> | 2018-06-19 04:48:34 +0000 |
commit | 37da4333a8671e7ac612ba5438881c5fde0ca01c (patch) | |
tree | 94b82340420f62441aa6d8011d6159477687475d /lldb/packages/Python/lldbsuite/support/sockutil.py | |
parent | b000a8860e9ec26f4a2834dbeaba44cd27025306 (diff) | |
download | bcm5719-llvm-37da4333a8671e7ac612ba5438881c5fde0ca01c.tar.gz bcm5719-llvm-37da4333a8671e7ac612ba5438881c5fde0ca01c.zip |
[SimplifyIndVars] Eliminate redundant truncs
This patch adds logic to deal with the following constructions:
%iv = phi i64 ...
%trunc = trunc i64 %iv to i32
%cmp = icmp <pred> i32 %trunc, %invariant
Replacing it with
%iv = phi i64 ...
%cmp = icmp <pred> i64 %iv, sext/zext(%invariant)
In case if it is legal. Specifically, if `%iv` has signed comparison users, it is
required that `sext(trunc(%iv)) == %iv`, and if it has unsigned comparison
uses then we require `zext(trunc(%iv)) == %iv`. The current implementation
bails if `%trunc` has other uses than `icmp`, but in theory we can handle more
cases here (e.g. if the user of trunc is bitcast).
Differential Revision: https://reviews.llvm.org/D47928
Reviewed By: reames
llvm-svn: 335020
Diffstat (limited to 'lldb/packages/Python/lldbsuite/support/sockutil.py')
0 files changed, 0 insertions, 0 deletions