File: pr14088.ll

package info (click to toggle)
llvm-toolchain-3.7 1%3A3.7.1-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 345,556 kB
  • ctags: 362,199
  • sloc: cpp: 2,156,381; ansic: 458,339; objc: 91,547; python: 89,988; asm: 86,305; sh: 21,479; makefile: 6,853; perl: 5,601; ml: 5,458; pascal: 3,933; lisp: 2,429; xml: 686; cs: 239; php: 202; csh: 117
file content (32 lines) | stat: -rw-r--r-- 884 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
; RUN: llc -mtriple x86_64-linux -mcpu core2 -verify-machineinstrs %s -o - | FileCheck %s
define i32 @f(i1 %foo, i16* %tm_year2, i8* %bar, i16 %zed, i32 %zed2) {
entry:
  br i1 %foo, label %return, label %if.end

if.end:
  %rem = srem i32 %zed2, 100
  %conv3 = trunc i32 %rem to i16
  store i16 %conv3, i16* %tm_year2
  %sext = shl i32 %rem, 16
  %conv5 = ashr exact i32 %sext, 16
  %div = sdiv i32 %conv5, 10
  %conv6 = trunc i32 %div to i8
  store i8 %conv6, i8* %bar
  br label %return

return:
  %retval.0 = phi i32 [ 0, %if.end ], [ -1, %entry ]
  ret i32 %retval.0
}

; We were miscompiling this and using %ax instead of %cx in the movw
; in the following sequence:
;	movswl	%cx, %ecx
;	movw	%cx, (%rsi)
;	movslq	%ecx, %rcx
;
; We can't produce the above sequence without special SD-level
; heuristics. Now we produce this:
; CHECK: movw	%ax, (%rsi)
; CHECK: cwtl
; CHECK: cltq