aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/MachineVerifier
diff options
context:
space:
mode:
authorJessica Paquette <jpaquette@apple.com>2021-08-19 15:41:36 -0700
committerJessica Paquette <jpaquette@apple.com>2021-08-19 17:06:24 -0700
commit311892648391ad8dce19d605f7b6c7b8a89d2430 (patch)
treec39c99a42943ce19255ee336d8519a4efd7c1632 /llvm/test/MachineVerifier
parent4bb36df144127c5bee6ea2607bc544c003aae446 (diff)
downloadllvm-311892648391ad8dce19d605f7b6c7b8a89d2430.zip
llvm-311892648391ad8dce19d605f7b6c7b8a89d2430.tar.gz
llvm-311892648391ad8dce19d605f7b6c7b8a89d2430.tar.bz2
[GlobalISel] Add a G_LROUND instruction
Meant to represent the `@llvm.lround.*` family. Add the opcode, docs, and verification. Differential Revision: https://reviews.llvm.org/D108417
Diffstat (limited to 'llvm/test/MachineVerifier')
-rw-r--r--llvm/test/MachineVerifier/test_g_lround.mir23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/MachineVerifier/test_g_lround.mir b/llvm/test/MachineVerifier/test_g_lround.mir
new file mode 100644
index 0000000..2f999b4
--- /dev/null
+++ b/llvm/test/MachineVerifier/test_g_lround.mir
@@ -0,0 +1,23 @@
+#RUN: not --crash llc -march=aarch64 -o - -global-isel -run-pass=none -verify-machineinstrs %s 2>&1 | FileCheck %s
+# REQUIRES: aarch64-registered-target
+
+---
+name: test_lround
+legalized: true
+regBankSelected: false
+selected: false
+tracksRegLiveness: true
+liveins:
+body: |
+ bb.0:
+ liveins: $x0, $q0
+ %ptr:_(p0) = COPY $x0
+ %vector:_(<2 x s64>) = COPY $q0
+
+ ; CHECK: Bad machine code: lround only supports scalars
+ ; CHECK: instruction: %no_ptrs:_(s32) = G_LROUND %ptr:_(p0)
+ %no_ptrs:_(s32) = G_LROUND %ptr:_(p0)
+
+ ; CHECK: Bad machine code: lround only supports scalars
+ ; CHECK: instruction: %no_vectors:_(s32) = G_LROUND %vector:_(<2 x s64>)
+ %no_vectors:_(s32) = G_LROUND %vector:_(<2 x s64>)