1 ; RUN: llc < %s -mtriple=i686-- | FileCheck %s
3 ; When doing sign extension, use the sext-load lowering to take advantage of
4 ; x86's sign extension during loads.
7 ; CHECK: movsbl {{.*}}, %eax
9 define i32 @test1(i32 %X) nounwind {
11 %tmp12 = trunc i32 %X to i8 ; <i8> [#uses=1]
12 %tmp123 = sext i8 %tmp12 to i32 ; <i32> [#uses=1]
16 ; When using a sextload representation, ensure that the sign extension is
17 ; preserved even when removing shifted-out low bits.
20 ; CHECK: movswl {{.*}}, %eax
22 define i32 @test2({i16, [6 x i8]}* %this) {
24 %b48 = getelementptr inbounds { i16, [6 x i8] }, { i16, [6 x i8] }* %this, i32 0, i32 1
25 %cast = bitcast [6 x i8]* %b48 to i48*
26 %bf.load = load i48, i48* %cast, align 2
27 %bf.ashr = ashr i48 %bf.load, 32
28 %bf.cast = trunc i48 %bf.ashr to i32