diff options
author | Sanjay Patel <spatel@rotateright.com> | 2017-01-27 23:26:27 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2017-01-27 23:26:27 +0000 |
commit | febcb9ce54e19c2b90f93b7547dceeebd3eca40d (patch) | |
tree | 60414b2eb52babc2ada280c22a5498d77ad8319c /llvm/lib/CodeGen/LiveDebugVariables.cpp | |
parent | eb21001111696d5e86ba233336974934fa24d421 (diff) | |
download | llvm-febcb9ce54e19c2b90f93b7547dceeebd3eca40d.zip llvm-febcb9ce54e19c2b90f93b7547dceeebd3eca40d.tar.gz llvm-febcb9ce54e19c2b90f93b7547dceeebd3eca40d.tar.bz2 |
[InstCombine] move icmp transforms that might be recognized as min/max and inf-loop (PR31751)
This is a minimal patch to avoid the infinite loop in:
https://llvm.org/bugs/show_bug.cgi?id=31751
But the general problem is bigger: we're not canonicalizing all of the min/max forms reported
by value tracking's matchSelectPattern(), and we don't define min/max consistently. Some code
uses matchSelectPattern(), other code uses matchers like m_Umax, and others have their own
inline definitions which may be subtly different from any of the above.
The reason that the test cases in this patch need a cast op to trigger is because we don't
(yet) canonicalize all min/max forms based on matchSelectPattern() in
canonicalizeMinMaxWithConstant(), but we do make min/max+cast transforms based on
matchSelectPattern() in visitSelectInst().
The location of the icmp transforms that trigger the inf-loop seems arbitrary at best, so
I'm moving those behind the min/max fence in visitICmpInst() as the quick fix.
llvm-svn: 293345
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp')
0 files changed, 0 insertions, 0 deletions