diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2018-03-12 17:43:02 +0000 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2018-03-12 17:43:02 +0000 |
commit | 92e359ed676eaf738ad8d87a096f12a43e4aecdc (patch) | |
tree | ddb684db5e0aeaf70074accea016bca4e0c08511 /llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp | |
parent | a0536c17b94dd76ec5c9cc1a3991a9ca7ecc3ab9 (diff) | |
download | llvm-92e359ed676eaf738ad8d87a096f12a43e4aecdc.zip llvm-92e359ed676eaf738ad8d87a096f12a43e4aecdc.tar.gz llvm-92e359ed676eaf738ad8d87a096f12a43e4aecdc.tar.bz2 |
[InstCombine] [NFC] Add tests for peeking through FP casts for sign-bit compares (PR36682)
Summary:
This pattern came up in PR36682:
https://bugs.llvm.org/show_bug.cgi?id=36682
https://godbolt.org/g/LhuD9A
Tests for proposed fix in D44367.
Looking at the IR pattern in question, as per [[ https://github.com/rutgers-apl/alive-nj | alive-nj ]], for all the type combinations i checked
(input: `i16`, `i32`, `i64`; intermediate: `half`/`i16`, `float`/`i32`, `double`/`i64`)
for the following `icmp` comparisons the `sitofp`+`bitcast` can be dropped:
* `eq 0`
* `ne 0`
* `slt 0`
* `sle 0`
* `sge 0`
* `sgt 0`
* `slt 1`
* `sge 1`
* `sle -1`
* `sgt -1`
I did not check vectors, but i'm guessing it's the same there.
{F5887419}
Thus all these cases are in the testcase (along with the vector variant with additional `undef` element in the middle).
There are no negative patterns here (unless alive-nj lied/is broken), all of these should be optimized.
Generated with {F5887551}
Reviewers: spatel, majnemer, efriedma, arsenm
Reviewed By: spatel
Subscribers: nlopes, wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D44390
llvm-svn: 327301
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp')
0 files changed, 0 insertions, 0 deletions