Displaying 1 result from an estimated 1 matches for "sel_0_or_".
Did you mean:
sel_0_or_1
2016 Sep 28
4
IR canonicalization: select or bool math?
....
Which, if any, of these is canonical?
1. Is a zext simpler than a select?
a. define i32 @sel_1_or_0(i1 %a) {
%b = select i1 %a, i32 1, i32 0
ret i32 %b
}
b. define i32 @sel_1_or_0(i1 %a) {
%b = zext i1 %a to i32
ret i32 %b
}
2. What if we have to 'not' the bool?
a. define i32 @sel_0_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 = zext i1 %not.a to i32
ret i32 %b
}
3. Is sext handled differently?
a. define i32 @sel_-1_or_0(i1 %a) {
%b = select i1 %a, i32 -1, i32 0
ret i32 %b
}
b. define i32...