26 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -passes='instcombine' -S < %s | FileCheck %s3 4define target("aarch64.svcount") @test_alloca_store_reload(target("aarch64.svcount") %val) nounwind {5; CHECK-LABEL: @test_alloca_store_reload(6; CHECK-NEXT: ret target("aarch64.svcount") [[VAL:%.*]]7;8 %ptr = alloca target("aarch64.svcount"), align 19 store target("aarch64.svcount") %val, ptr %ptr10 %res = load target("aarch64.svcount"), ptr %ptr11 ret target("aarch64.svcount") %res12}13 14; Test that instcombine doesn't try to query the (scalable) size of target("aarch64.svcount")15; in foldSelectInstWithICmp.16define target("aarch64.svcount") @test_combine_on_select(target("aarch64.svcount") %x, target("aarch64.svcount") %y, i32 %k) {17; CHECK-LABEL: @test_combine_on_select(18; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[K:%.*]], 4219; CHECK-NEXT: [[X_Y:%.*]] = select i1 [[CMP]], target("aarch64.svcount") [[X:%.*]], target("aarch64.svcount") [[Y:%.*]]20; CHECK-NEXT: ret target("aarch64.svcount") [[X_Y]]21;22 %cmp = icmp sgt i32 %k, 4223 %x.y = select i1 %cmp, target("aarch64.svcount") %x, target("aarch64.svcount") %y24 ret target("aarch64.svcount") %x.y25}26