mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-17 03:07:06 +00:00
e4d87aa2de
This patch removes the SetCC instructions and replaces them with the ICmp and FCmp instructions. The SetCondInst instruction has been removed and been replaced with ICmpInst and FCmpInst. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32751 91177308-0d34-0410-b5e6-96231b3b80d8
32 lines
729 B
LLVM
32 lines
729 B
LLVM
; This test ensures that "strength reduction" of conditional expressions are
|
|
; working. Basically this boils down to converting setlt,gt,le,ge instructions
|
|
; into equivalent setne,eq instructions.
|
|
;
|
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep -v 'icmp eq' | grep -v 'icmp ne' | not grep icmp
|
|
|
|
bool %test1(uint %A) {
|
|
%B = setge uint %A, 1 ; setne %A, 0
|
|
ret bool %B
|
|
}
|
|
|
|
bool %test2(uint %A) {
|
|
%B = setgt uint %A, 0 ; setne %A, 0
|
|
ret bool %B
|
|
}
|
|
|
|
bool %test3(sbyte %A) {
|
|
%B = setge sbyte %A, -127 ; setne %A, -128
|
|
ret bool %B
|
|
}
|
|
|
|
bool %test4(sbyte %A) {
|
|
%B = setle sbyte %A, 126 ; setne %A, 127
|
|
ret bool %B
|
|
}
|
|
|
|
bool %test5(sbyte %A) {
|
|
%B = setlt sbyte %A, 127 ; setne %A, 127
|
|
ret bool %B
|
|
}
|