1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64 -mattr=+gcs -verify-machineinstrs -o - %s | FileCheck %s
4 ; We call each intrinsic twice, once with the result being unused and once with
5 ; it being used, to check that dead code elimination is being done correctly.
6 ; chkfeat does not have side effects so can be eliminated, but the others do and
9 define i64 @test_chkfeat(i64 %arg) {
10 ; CHECK-LABEL: test_chkfeat:
11 ; CHECK: // %bb.0: // %entry
12 ; CHECK-NEXT: mov x16, x0
13 ; CHECK-NEXT: chkfeat x16
14 ; CHECK-NEXT: mov x0, x16
17 %0 = call i64 @llvm.aarch64.chkfeat(i64 %arg)
18 %1 = call i64 @llvm.aarch64.chkfeat(i64 %arg)
22 define i64 @test_gcspopm(i64 %arg) {
23 ; CHECK-LABEL: test_gcspopm:
24 ; CHECK: // %bb.0: // %entry
25 ; CHECK-NEXT: mov x8, x0
26 ; CHECK-NEXT: gcspopm x8
27 ; CHECK-NEXT: gcspopm x0
30 %0 = call i64 @llvm.aarch64.gcspopm(i64 %arg)
31 %1 = call i64 @llvm.aarch64.gcspopm(i64 %arg)
35 define ptr @test_gcsss(ptr %p) {
36 ; CHECK-LABEL: test_gcsss:
37 ; CHECK: // %bb.0: // %entry
38 ; CHECK-NEXT: mov x9, xzr
39 ; CHECK-NEXT: gcsss1 x0
40 ; CHECK-NEXT: mov x8, xzr
41 ; CHECK-NEXT: gcsss2 x9
42 ; CHECK-NEXT: gcsss1 x0
43 ; CHECK-NEXT: gcsss2 x8
44 ; CHECK-NEXT: mov x0, x8
47 %0 = call ptr @llvm.aarch64.gcsss(ptr %p)
48 %1 = call ptr @llvm.aarch64.gcsss(ptr %p)
52 declare i64 @llvm.aarch64.chkfeat(i64)
53 declare i64 @llvm.aarch64.gcspopm(i64)
54 declare ptr @llvm.aarch64.gcsss(ptr)