mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-23 15:29:51 +00:00
dcfd3a798f
if the extension types were not the same. The result was that if you fed a select with sext and zext loads, as in the testcase, then it would get turned into a zext (or sext) of the select, which is wrong in the cases when it should have been an sext (resp. zext). Reported and diagnosed by Sebastien Deldon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119728 91177308-0d34-0410-b5e6-96231b3b80d8
16 lines
386 B
LLVM
16 lines
386 B
LLVM
; RUN: llc < %s -march=x86 | FileCheck %s
|
|
; Both values were being zero extended.
|
|
@u = external global i8
|
|
@s = external global i8
|
|
define i32 @foo(i1 %cond) {
|
|
; CHECK: @foo
|
|
%u_base = load i8* @u
|
|
%u_val = zext i8 %u_base to i32
|
|
; CHECK: movzbl
|
|
; CHECK: movsbl
|
|
%s_base = load i8* @s
|
|
%s_val = sext i8 %s_base to i32
|
|
%val = select i1 %cond, i32 %u_val, i32 %s_val
|
|
ret i32 %val
|
|
}
|