Test folding comparisons into select instructions

llvm-svn: 12559
This commit is contained in:
Chris Lattner 2004-03-30 22:37:04 +00:00
parent 399515cbfb
commit beaf1cdb85

View File

@ -30,3 +30,21 @@ double %doubleSel(bool %A, double %B, double %C) {
ret double %X
}
sbyte %foldSel(bool %A, sbyte %B, sbyte %C) {
%Cond = setlt sbyte %B, %C
%X = select bool %Cond, sbyte %B, sbyte %C
ret sbyte %X
}
int %foldSel2(bool %A, int %B, int %C) {
%Cond = seteq int %B, %C
%X = select bool %Cond, int %B, int %C
ret int %X
}
int %foldSel2(bool %A, int %B, int %C, double %X, double %Y) {
%Cond = setlt double %X, %Y
%X = select bool %Cond, int %B, int %C
ret int %X
}