55 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=aarch64 -mattr=+gcs -verify-machineinstrs -o - %s | FileCheck %s3 4; We call each intrinsic twice, once with the result being unused and once with5; 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 and7; can't be eliminated.8 9define i64 @test_chkfeat(i64 %arg) {10; CHECK-LABEL: test_chkfeat:11; CHECK: // %bb.0: // %entry12; CHECK-NEXT: mov x16, x013; CHECK-NEXT: chkfeat x1614; CHECK-NEXT: mov x0, x1615; CHECK-NEXT: ret16entry:17 %0 = call i64 @llvm.aarch64.chkfeat(i64 %arg)18 %1 = call i64 @llvm.aarch64.chkfeat(i64 %arg)19 ret i64 %120}21 22define i64 @test_gcspopm(i64 %arg) {23; CHECK-LABEL: test_gcspopm:24; CHECK: // %bb.0: // %entry25; CHECK-NEXT: mov x8, x026; CHECK-NEXT: gcspopm x827; CHECK-NEXT: gcspopm x028; CHECK-NEXT: ret29entry:30 %0 = call i64 @llvm.aarch64.gcspopm(i64 %arg)31 %1 = call i64 @llvm.aarch64.gcspopm(i64 %arg)32 ret i64 %133}34 35define ptr @test_gcsss(ptr %p) {36; CHECK-LABEL: test_gcsss:37; CHECK: // %bb.0: // %entry38; CHECK-NEXT: mov x9, xzr39; CHECK-NEXT: gcsss1 x040; CHECK-NEXT: mov x8, xzr41; CHECK-NEXT: gcsss2 x942; CHECK-NEXT: gcsss1 x043; CHECK-NEXT: gcsss2 x844; CHECK-NEXT: mov x0, x845; CHECK-NEXT: ret46entry:47 %0 = call ptr @llvm.aarch64.gcsss(ptr %p)48 %1 = call ptr @llvm.aarch64.gcsss(ptr %p)49 ret ptr %150}51 52declare i64 @llvm.aarch64.chkfeat(i64)53declare i64 @llvm.aarch64.gcspopm(i64)54declare ptr @llvm.aarch64.gcsss(ptr)55