[llvm] [SPIRV] Implement support for SPV_KHR_expect_assume (PR #66217)
Michal Paszkowski via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 25 00:11:09 PDT 2023
================
@@ -0,0 +1,15 @@
+; RUN: llc -mtriple=spirv32-unknown-unknown < %s | FileCheck %s
+; RUN: llc -mtriple=spirv64-unknown-unknown < %s | FileCheck %s
+
+; CHECK: OpCapability ExpectAssumeKHR
+; CHECK-NEXT: OpExtension "SPV_KHR_expect_assume"
+
+declare void @llvm.assume(i1)
+
+; CHECK-DAG: %9 = OpIEqual %5 %6 %7
+; CHECK-NEXT: OpAssumeTrueKHR %9
+define void @assumeeq(i32 %x, i32 %y) {
+ %cmp = icmp eq i32 %x, %y
+ call void @llvm.assume(i1 %cmp)
+ ret void
+}
----------------
michalpaszkowski wrote:
Please add a new line at the end of file.
https://github.com/llvm/llvm-project/pull/66217
More information about the llvm-commits
mailing list