summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM/hints.ll
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-04-25 17:24:24 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-04-25 17:24:24 +0000
commit7e7c2f9ca69b87a1ff1b0030dfddf1e782c2c31d (patch)
treea881c39f262a63d743989f679927a5a0f37e6553 /llvm/test/CodeGen/ARM/hints.ll
parent01bbd1b1c379acfd740be2d2a5845db508b2825d (diff)
downloadbcm5719-llvm-7e7c2f9ca69b87a1ff1b0030dfddf1e782c2c31d.tar.gz
bcm5719-llvm-7e7c2f9ca69b87a1ff1b0030dfddf1e782c2c31d.zip
ARM: provide a new generic hint intrinsic
Introduce the llvm.arm.hint(i32) intrinsic that can be used to inject hints into the instruction stream. This is particularly useful for generating IR from a compiler where the user may inject an intrinsic (e.g. __yield). These are then pattern substituted into the correct instruction which already existed. llvm-svn: 207242
Diffstat (limited to 'llvm/test/CodeGen/ARM/hints.ll')
-rw-r--r--llvm/test/CodeGen/ARM/hints.ll69
1 files changed, 69 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/hints.ll b/llvm/test/CodeGen/ARM/hints.ll
new file mode 100644
index 00000000000..18abbbecaaf
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/hints.ll
@@ -0,0 +1,69 @@
+; RUN: llc -mtriple armv7-eabi -o - %s | FileCheck %s
+; RUN: llc -mtriple thumbv6m-eabi -o - %s | FileCheck %s
+; RUN: llc -mtriple thumbv7-eabi -o - %s | FileCheck %s
+
+declare void @llvm.arm.hint(i32) nounwind
+
+define void @hint_nop() {
+entry:
+ tail call void @llvm.arm.hint(i32 0) nounwind
+ ret void
+}
+
+; CHECK-LABEL: hint_nop
+; CHECK: nop
+
+define void @hint_yield() {
+entry:
+ tail call void @llvm.arm.hint(i32 1) nounwind
+ ret void
+}
+
+; CHECK-LABEL: hint_yield
+; CHECK: yield
+
+define void @hint_wfe() {
+entry:
+ tail call void @llvm.arm.hint(i32 2) nounwind
+ ret void
+}
+
+; CHECK-LABEL: hint_wfe
+; CHECK: wfe
+
+define void @hint_wfi() {
+entry:
+ tail call void @llvm.arm.hint(i32 3) nounwind
+ ret void
+}
+
+; CHECK-LABEL: hint_wfi
+; CHECK: wfi
+
+define void @hint_sev() {
+entry:
+ tail call void @llvm.arm.hint(i32 4) nounwind
+ ret void
+}
+
+; CHECK-LABEL: hint_sev
+; CHECK: sev
+
+define void @hint_sevl() {
+entry:
+ tail call void @llvm.arm.hint(i32 5) nounwind
+ ret void
+}
+
+; CHECK-LABEL: hint_sevl
+; CHECK: hint #5
+
+define void @hint_undefined() {
+entry:
+ tail call void @llvm.arm.hint(i32 8) nounwind
+ ret void
+}
+
+; CHECK-LABEL: hint_undefined
+; CHECK: hint #8
+
OpenPOWER on IntegriCloud