[PATCH] D44367: [InstCombine] peek through FP casts for sign-bit compares (PR36682)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 12 07:22:44 PDT 2018


lebedev.ri added a comment.

Looking more at this, as per alive-nj <https://github.com/rutgers-apl/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: alivenj-bitcast.txt <https://reviews.llvm.org/F5887419>
Will put up the testcase diff up next.


https://reviews.llvm.org/D44367





More information about the llvm-commits mailing list