mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-09 10:31:14 +00:00
b493b2774c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58351 91177308-0d34-0410-b5e6-96231b3b80d8
21 lines
501 B
LLVM
21 lines
501 B
LLVM
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep select | count 2
|
|
|
|
define i32 @foo(i32 %a, i32 %b, i32 %c, i32 %d) nounwind {
|
|
%e = icmp slt i32 %a, %b
|
|
%f = sext i1 %e to i32
|
|
%g = and i32 %c, %f
|
|
%h = xor i32 %f, -1
|
|
%i = and i32 %d, %h
|
|
%j = or i32 %g, %i
|
|
ret i32 %j
|
|
}
|
|
define i32 @bar(i32 %a, i32 %b, i32 %c, i32 %d) nounwind {
|
|
%e = icmp slt i32 %a, %b
|
|
%f = sext i1 %e to i32
|
|
%g = and i32 %c, %f
|
|
%h = xor i32 %f, -1
|
|
%i = and i32 %d, %h
|
|
%j = or i32 %i, %g
|
|
ret i32 %j
|
|
}
|