1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00
llvm-mirror/test/CodeGen/X86/constant-hoisting-cmp.ll
Matthias Braun f7935a3f63 X86: Do not use llc -march in tests.
`llc -march` is problematic because it only switches the target
architecture, but leaves the operating system unchanged. This
occasionally leads to indeterministic tests because the OS from
LLVM_DEFAULT_TARGET_TRIPLE is used.

However we can simply always use `llc -mtriple` instead. This changes
all the tests to do this to avoid people using -march when they copy and
paste parts of tests.

See also the discussion in https://reviews.llvm.org/D35287

llvm-svn: 309774
2017-08-02 00:28:10 +00:00

26 lines
657 B
LLVM

; RUN: llc < %s -O3 -mtriple=x86_64-- |FileCheck %s
define i64 @foo(i64 %data1, i64 %data2, i64 %data3)
{
; If constant 4294967295 is hoisted to a variable, then we won't be able to
; use a shift right by 32 to optimize the compare.
entry:
%val1 = add i64 %data3, 1
%x = icmp ugt i64 %data1, 4294967295
br i1 %x, label %End, label %L_val2
; CHECK: shrq $32, {{.*}}
; CHECK: shrq $32, {{.*}}
L_val2:
%val2 = add i64 %data3, 2
%y = icmp ugt i64 %data2, 4294967295
br i1 %y, label %End, label %L_val3
L_val3:
%val3 = add i64 %data3, 3
br label %End
End:
%p1 = phi i64 [%val1,%entry], [%val2,%L_val2], [%val3,%L_val3]
ret i64 %p1
}