We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://alive2.llvm.org/ce/z/w-iYiR
so if we compile this function:
define i32 @t1_ult_slt_0(i32 %x, i32 %replacement_low, i32 %replacement_high) { %t0 = icmp slt i32 %x, 0 %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high %t2 = icmp ult i32 %x, 65536 %1 = xor i1 %t2, true %r = select i1 %1, i32 %x, i32 %t1 ret i32 %r }
alongside this test driver:
#include <stdio.h> unsigned t1_ult_slt_0(unsigned a, unsigned b, unsigned c); int main(void) { printf("%u\n", t1_ult_slt_0(2, 0, 1)); }
the output is 1
1
optimizing the function using instcombine we get this:
regehr@john-home:~/Downloads$ opt -instcombine foo.ll -S -o - ; ModuleID = 'foo.ll' source_filename = "foo.ll" define i32 @t1_ult_slt_0(i32 %x, i32 %replacement_low, i32 %replacement_high) { %1 = icmp slt i32 %x, 0 %2 = icmp sgt i32 %x, 65535 %3 = select i1 %1, i32 %replacement_low, i32 %x %4 = select i1 %2, i32 %replacement_high, i32 %3 ret i32 %4 } regehr@john-home:~/Downloads$
compiling the optimized function, using the same test driver, results in 2 being printed
2
found by @Hatsunespica's test generater + Alive2 cc @nunoplopes
The text was updated successfully, but these errors were encountered:
cc @rotateright @nikic @LebedevRI
Sorry, something went wrong.
Sent out https://reviews.llvm.org/D119690 to fix this.
[InstCombine] Add tests reproducing PR53252 (NFC)
077488a
This are baseline tests for D119690 ( #53252 ) Differential Revision: https://reviews.llvm.org/D119689
4041c44
Thanks!
No branches or pull requests
https://alive2.llvm.org/ce/z/w-iYiR
so if we compile this function:
alongside this test driver:
the output is
1
optimizing the function using instcombine we get this:
compiling the optimized function, using the same test driver, results in
2
being printedfound by @Hatsunespica's test generater + Alive2
cc @nunoplopes
The text was updated successfully, but these errors were encountered: