• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=i686-- -x86-asm-syntax=intel | FileCheck %s
3
4; PR687
5
6define i64 @foo(i64 %x, i64* %X) {
7; CHECK-LABEL: foo:
8; CHECK:       # %bb.0:
9; CHECK-NEXT:    push esi
10; CHECK-NEXT:    .cfi_def_cfa_offset 8
11; CHECK-NEXT:    .cfi_offset esi, -8
12; CHECK-NEXT:    mov esi, dword ptr [esp + 8]
13; CHECK-NEXT:    mov edx, dword ptr [esp + 12]
14; CHECK-NEXT:    mov eax, dword ptr [esp + 16]
15; CHECK-NEXT:    mov cl, byte ptr [eax]
16; CHECK-NEXT:    mov eax, esi
17; CHECK-NEXT:    shl eax, cl
18; CHECK-NEXT:    shld edx, esi, cl
19; CHECK-NEXT:    test cl, 32
20; CHECK-NEXT:    je .LBB0_2
21; CHECK-NEXT:  # %bb.1:
22; CHECK-NEXT:    mov edx, eax
23; CHECK-NEXT:    xor eax, eax
24; CHECK-NEXT:  .LBB0_2:
25; CHECK-NEXT:    pop esi
26; CHECK-NEXT:    .cfi_def_cfa_offset 4
27; CHECK-NEXT:    ret
28        %tmp.1 = load i64, i64* %X           ; <i64> [#uses=1]
29        %tmp.3 = trunc i64 %tmp.1 to i8         ; <i8> [#uses=1]
30        %shift.upgrd.1 = zext i8 %tmp.3 to i64          ; <i64> [#uses=1]
31        %tmp.4 = shl i64 %x, %shift.upgrd.1             ; <i64> [#uses=1]
32        ret i64 %tmp.4
33}
34
35