mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-16 11:30:51 +00:00
8401ed21aa
if ((x & 255) == 255) before: movzbl %al, %eax cmpl $255, %eax after: cmpb $-1, %al git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182038 91177308-0d34-0410-b5e6-96231b3b80d8
53 lines
944 B
LLVM
53 lines
944 B
LLVM
; RUN: llc < %s -march=x86-64 | FileCheck %s
|
|
|
|
declare void @bar()
|
|
|
|
define void @test1(i32* nocapture %X) nounwind {
|
|
entry:
|
|
%tmp1 = load i32* %X, align 4
|
|
%and = and i32 %tmp1, 255
|
|
%cmp = icmp eq i32 %and, 47
|
|
br i1 %cmp, label %if.then, label %if.end
|
|
|
|
if.then:
|
|
tail call void @bar() nounwind
|
|
br label %if.end
|
|
|
|
if.end:
|
|
ret void
|
|
; CHECK: test1:
|
|
; CHECK: cmpb $47, (%{{rdi|rcx}})
|
|
}
|
|
|
|
define void @test2(i32 %X) nounwind {
|
|
entry:
|
|
%and = and i32 %X, 255
|
|
%cmp = icmp eq i32 %and, 47
|
|
br i1 %cmp, label %if.then, label %if.end
|
|
|
|
if.then:
|
|
tail call void @bar() nounwind
|
|
br label %if.end
|
|
|
|
if.end:
|
|
ret void
|
|
; CHECK: test2:
|
|
; CHECK: cmpb $47, %{{dil|cl}}
|
|
}
|
|
|
|
define void @test3(i32 %X) nounwind {
|
|
entry:
|
|
%and = and i32 %X, 255
|
|
%cmp = icmp eq i32 %and, 255
|
|
br i1 %cmp, label %if.then, label %if.end
|
|
|
|
if.then:
|
|
tail call void @bar() nounwind
|
|
br label %if.end
|
|
|
|
if.end:
|
|
ret void
|
|
; CHECK: test3:
|
|
; CHECK: cmpb $-1, %{{dil|cl}}
|
|
}
|