Displaying 1 result from an estimated 1 matches for "sel_2_or_1".
Did you mean:
sel_0_or_1
2016 Sep 28
4
IR canonicalization: select or bool math?
...or_-1(i1 %a) {
%b = select i1 %a, i32 0, i32 -1
ret i32 %b
}
b. define i32 @sel_0_or_-1(i1 %a) {
%not.a = xor i1 %a, true
%b = sext i1 %not.a to i32
ret i32 %b
}
5. What if both constants are non-zero? Ie, the implicit add/sub of the
earlier cases can't be eliminated.
a. define i32 @sel_2_or_1(i1 %a) {
%b = select i1 %a, i32 2, i32 1
ret i32 %b
}
b. define i32 @sel_2_or_1(i1 %a) {
%b = zext i1 to i32 %a
%c = add i32 %b, 1
ret i32 %b
}
6. Does 'sub' make a difference?
a. define i32 @sel_1_or_2(i1 %a) {
%b = select i1 %a, i32 1, i32 2
ret i32 %b
}
b. define i32 @se...