Displaying 1 result from an estimated 1 matches for "sel_".
Did you mean:
sel
2016 Sep 28
4
IR canonicalization: select or bool math?
..., please disregard prior knowledge of how this is
handled by instcombine or how this is lowered by your favorite target...of
course we'll fix it. :) Some answers in the links below if you do want to
know.
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(i...