mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-12 13:30:51 +00:00
ad78a88711
check the range of the constant when optimizing a comparison between a constant and a sign_extend_inreg node. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109854 91177308-0d34-0410-b5e6-96231b3b80d8
15 lines
459 B
LLVM
15 lines
459 B
LLVM
; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck %s
|
|
|
|
define i32 @extend2bit_v2(i32 %val) {
|
|
entry:
|
|
%0 = trunc i32 %val to i2 ; <i2> [#uses=1]
|
|
%1 = sext i2 %0 to i32 ; <i32> [#uses=1]
|
|
%2 = icmp eq i32 %1, 3 ; <i1> [#uses=1]
|
|
%3 = zext i1 %2 to i32 ; <i32> [#uses=1]
|
|
ret i32 %3
|
|
}
|
|
|
|
; CHECK: extend2bit_v2:
|
|
; CHECK: xorl %eax, %eax
|
|
; CHECK-NEXT: ret
|