aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/CodeGenPrepare/invariant.group.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/CodeGenPrepare/invariant.group.ll')
-rw-r--r--test/Transforms/CodeGenPrepare/invariant.group.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Transforms/CodeGenPrepare/invariant.group.ll b/test/Transforms/CodeGenPrepare/invariant.group.ll
new file mode 100644
index 000000000000..e8f1e42ddcbb
--- /dev/null
+++ b/test/Transforms/CodeGenPrepare/invariant.group.ll
@@ -0,0 +1,23 @@
+; RUN: opt -codegenprepare -S < %s | FileCheck %s
+
+@tmp = global i8 0
+
+; CHECK-LABEL: define void @foo() {
+define void @foo() {
+enter:
+ ; CHECK-NOT: !invariant.group
+ ; CHECK-NOT: @llvm.invariant.group.barrier(
+ ; CHECK: %val = load i8, i8* @tmp
+ %val = load i8, i8* @tmp, !invariant.group !0
+ %ptr = call i8* @llvm.invariant.group.barrier(i8* @tmp)
+
+ ; CHECK: store i8 42, i8* @tmp
+ store i8 42, i8* %ptr, !invariant.group !0
+
+ ret void
+}
+; CHECK-LABEL: }
+
+declare i8* @llvm.invariant.group.barrier(i8*)
+
+!0 = !{!"something"} \ No newline at end of file