xref: /minix3/external/bsd/llvm/dist/llvm/test/CodeGen/X86/fast-isel-constant.ll (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc; RUN: llc < %s -march=x86-64 -O0 | FileCheck %s
2*f4a2713aSLionel Sambuc; Make sure fast-isel doesn't reset the materialised constant map
3*f4a2713aSLionel Sambuc; across an intrinsic call.
4*f4a2713aSLionel Sambuc
5*f4a2713aSLionel Sambuc; CHECK: movl	$100000
6*f4a2713aSLionel Sambuc; CHECK-NOT: movl	$100000
7*f4a2713aSLionel Sambucdefine i1 @test1(i32 %v1, i32 %v2, i32* %X) nounwind {
8*f4a2713aSLionel Sambucentry:
9*f4a2713aSLionel Sambuc  %a = shl i32 100000, %v1
10*f4a2713aSLionel Sambuc  %t = call {i32, i1} @llvm.sadd.with.overflow.i32(i32 %a, i32 %v2)
11*f4a2713aSLionel Sambuc  %ext = extractvalue {i32, i1} %t, 0
12*f4a2713aSLionel Sambuc  %sum = shl i32 100000, %ext
13*f4a2713aSLionel Sambuc  %obit = extractvalue {i32, i1} %t, 1
14*f4a2713aSLionel Sambuc  br i1 %obit, label %overflow, label %normal
15*f4a2713aSLionel Sambuc
16*f4a2713aSLionel Sambucnormal:
17*f4a2713aSLionel Sambuc  store i32 %sum, i32* %X
18*f4a2713aSLionel Sambuc  br label %overflow
19*f4a2713aSLionel Sambuc
20*f4a2713aSLionel Sambucoverflow:
21*f4a2713aSLionel Sambuc  ret i1 false
22*f4a2713aSLionel Sambuc}
23*f4a2713aSLionel Sambuc
24*f4a2713aSLionel Sambucdeclare {i32, i1} @llvm.sadd.with.overflow.i32(i32, i32)
25