NVPTX: Use MapMetadata() instead of custom/stale/untested logic
[oota-llvm.git] / test / CodeGen / X86 / noop-insert.ll
1 ; REQUIRES: disabled
2
3 ; RUN: llc < %s -mtriple=x86_64-linux -noop-insertion | FileCheck %s
4 ; RUN: llc < %s -mtriple=x86_64-linux -noop-insertion -rng-seed=1 | FileCheck %s --check-prefix=SEED1
5 ; RUN: llc < %s -mtriple=x86_64-linux -noop-insertion -rng-seed=20 | FileCheck %s --check-prefix=SEED2
6 ; RUN: llc < %s -mtriple=x86_64-linux -noop-insertion -rng-seed=500 | FileCheck %s --check-prefix=SEED3
7
8 ; RUN: llc < %s -march=x86 -noop-insertion | FileCheck %s --check-prefix=x86_32
9
10 ; This test case checks that NOOPs are inserted, and that the RNG seed
11 ; affects both the placement (position of imull) and choice of these NOOPs.
12
13 ; It just happens that with a default percentage of 25% and seed=0,
14 ; no NOOPs are inserted.
15 ; CHECK: imull
16 ; CHECK-NEXT: leal
17 ; CHECK-NEXT: retq
18 ; CHECK-NOT: nop
19
20 ; SEED1: leaq (%rsi), %rsi
21 ; SEED1-NEXT: imull
22 ; SEED1-NEXT: leal
23 ; SEED1-NEXT: retq
24
25 ; SEED2: imull
26 ; SEED2-NEXT: movq %rsp, %rsp
27 ; SEED2-NEXT: leal
28 ; SEED2-NEXT: retq
29
30 ; SEED3: imull
31 ; SEED3-NEXT: movq %rsp, %rsp
32 ; SEED3-NEXT: leal
33 ; SEED3-NEXT: leaq (%rdi), %rdi
34 ; SEED3-NEXT: retq
35
36 ; The operand of the following is used to distinguish from a movl NOOP
37 ; x86_32: movl 4(%esp),
38 ; x86_32-NEXT: imull
39 ; x86_32-NEXT: addl
40 ; x86_32-NEXT: movl %esp, %esp
41 ; x86_32-NEXT: retl
42
43 define i32 @test1(i32 %x, i32 %y, i32 %z) {
44 entry:
45     %tmp = mul i32 %x, %y
46     %tmp2 = add i32 %tmp, %z
47     ret i32 %tmp2
48 }