1 ; RUN: llc -verify-machineinstrs -mtriple=spirv32-unknown-unknown --spirv-ext=+SPV_KHR_expect_assume < %s | FileCheck --check-prefixes=CHECK,EXT %s
2 ; RUN: llc -verify-machineinstrs -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_KHR_expect_assume < %s | FileCheck --check-prefixes=CHECK,EXT %s
3 ; RUN: llc -verify-machineinstrs -mtriple=spirv32-unknown-unknown < %s | FileCheck --check-prefixes=CHECK,NOEXT %s
4 ; RUN: llc -verify-machineinstrs -mtriple=spirv64-unknown-unknown < %s | FileCheck --check-prefixes=CHECK,NOEXT %s
6 ; EXT: OpCapability ExpectAssumeKHR
7 ; EXT-NEXT: OpExtension "SPV_KHR_expect_assume"
8 ; NOEXT-NOT: OpCapability ExpectAssumeKHR
9 ; NOEXT-NOT: OpExtension "SPV_KHR_expect_assume"
11 declare i32 @llvm.expect.i32(i32, i32)
14 ; CHECK-DAG: %2 = OpTypeInt 32 0
15 ; CHECK-DAG: %6 = OpFunctionParameter %2
16 ; CHECK-DAG: %9 = OpIMul %2 %6 %8
17 ; EXT-DAG: %10 = OpExpectKHR %2 %9 %6
18 ; NOEXT-NOT: %10 = OpExpectKHR %2 %9 %6
20 define i32 @test(i32 %x) {
21 %one = call i32 @getOne()
22 %val = mul i32 %x, %one
23 %v = call i32 @llvm.expect.i32(i32 %val, i32 %x)