-
Notifications
You must be signed in to change notification settings - Fork 25
[AIE2P] Combine VST.PUSH.CONV #351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py | ||
# | ||
# This file is licensed under the Apache License v2.0 with LLVM Exceptions. | ||
# See https://llvm.org/LICENSE.txt for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
# | ||
# (c) Copyright 2025 Advanced Micro Devices, Inc. or its affiliates | ||
# RUN: llc -mtriple aie2p -run-pass=instruction-select %s -verify-machineinstrs -o - | FileCheck %s | ||
|
||
--- | ||
name: test_fifo_st_push_576_conv_accfloat_to_bfp16ebs8 | ||
tracksRegLiveness: true | ||
legalized: true | ||
regBankSelected: true | ||
body: | | ||
bb.1.entry: | ||
liveins: $p0, $dm0 | ||
; CHECK-LABEL: name: test_fifo_st_push_576_conv_accfloat_to_bfp16ebs8 | ||
; CHECK: liveins: $p0, $dm0 | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: [[COPY:%[0-9]+]]:acc2048 = COPY $dm0 | ||
; CHECK-NEXT: [[DEF:%[0-9]+]]:mpfs = IMPLICIT_DEF | ||
; CHECK-NEXT: [[DEF1:%[0-9]+]]:mstfifo = IMPLICIT_DEF | ||
; CHECK-NEXT: [[DEF2:%[0-9]+]]:mr26_fifo_st = IMPLICIT_DEF | ||
; CHECK-NEXT: [[VST_PUSH_576_CONV_bfp16ebs8_fp32_:%[0-9]+]]:mstfifo, [[VST_PUSH_576_CONV_bfp16ebs8_fp32_1:%[0-9]+]]:mpfs, [[VST_PUSH_576_CONV_bfp16ebs8_fp32_2:%[0-9]+]]:mr26_fifo_st = VST_PUSH_576_CONV_bfp16ebs8_fp32 [[DEF1]], [[COPY]], [[DEF]], [[DEF2]], implicit-def $srf2bflags, implicit-def $srfifo_of, implicit $crf2bmask, implicit $crrnd | ||
; CHECK-NEXT: PseudoRET implicit $lr | ||
%0:ptrregbank(p0) = COPY $p0 | ||
%1:accregbank(<64 x s32>) = COPY $dm0 | ||
%2:ptrregbank(p0) = IMPLICIT_DEF | ||
%3:fiforegbank(<32 x s32>) = IMPLICIT_DEF | ||
%4:gprregbank(s32) = IMPLICIT_DEF | ||
%5:vregbank(<64 x s8>), %6:gprregbank(<8 x s8>) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.aie2p.v64accfloat.to.v64bfp16ebs8), %1(<64 x s32>) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems to be testing the same intrinsic as the test below. I guess you meant to test There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have different stores in both tests |
||
%7:ptrregbank(p0), %8:fiforegbank(<32 x s32>), %9:gprregbank(s32) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.aie2p.fifo.st.push.576.bfp16), %2:ptrregbank(p0), %5:vregbank(<64 x s8>), %6:gprregbank(<8 x s8>), %3:fiforegbank(<32 x s32>), %4:gprregbank(s32) | ||
PseudoRET implicit $lr | ||
... | ||
|
||
--- | ||
name: test_fifo_st_push_544_conv_accfloat_to_bfp16ebs8 | ||
tracksRegLiveness: true | ||
legalized: true | ||
regBankSelected: true | ||
body: | | ||
bb.1.entry: | ||
liveins: $p0, $dm0 | ||
; CHECK-LABEL: name: test_fifo_st_push_544_conv_accfloat_to_bfp16ebs8 | ||
; CHECK: liveins: $p0, $dm0 | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: [[COPY:%[0-9]+]]:acc2048 = COPY $dm0 | ||
; CHECK-NEXT: [[DEF:%[0-9]+]]:mpfs = IMPLICIT_DEF | ||
; CHECK-NEXT: [[DEF1:%[0-9]+]]:mstfifo = IMPLICIT_DEF | ||
; CHECK-NEXT: [[DEF2:%[0-9]+]]:mr26_fifo_st = IMPLICIT_DEF | ||
; CHECK-NEXT: [[VST_PUSH_544_CONV_bfp16ebs16_fp32_:%[0-9]+]]:mstfifo, [[VST_PUSH_544_CONV_bfp16ebs16_fp32_1:%[0-9]+]]:mpfs, [[VST_PUSH_544_CONV_bfp16ebs16_fp32_2:%[0-9]+]]:mr26_fifo_st = VST_PUSH_544_CONV_bfp16ebs16_fp32 [[DEF1]], [[COPY]], [[DEF]], [[DEF2]], implicit-def $srf2bflags, implicit-def $srfifo_of, implicit $crf2bmask, implicit $crrnd | ||
; CHECK-NEXT: PseudoRET implicit $lr | ||
%0:ptrregbank(p0) = COPY $p0 | ||
%1:accregbank(<64 x s32>) = COPY $dm0 | ||
%2:ptrregbank(p0) = IMPLICIT_DEF | ||
%3:fiforegbank(<32 x s32>) = IMPLICIT_DEF | ||
%4:gprregbank(s32) = IMPLICIT_DEF | ||
%5:vregbank(<64 x s8>), %6:gprregbank(<8 x s8>) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.aie2p.v64accfloat.to.v64bfp16ebs8), %1(<64 x s32>) | ||
%7:ptrregbank(p0), %8:fiforegbank(<32 x s32>), %9:gprregbank(s32) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.aie2p.fifo.st.push.544.bfp16), %2:ptrregbank(p0), %5:vregbank(<64 x s8>), %6:gprregbank(<8 x s8>), %3:fiforegbank(<32 x s32>), %4:gprregbank(s32) | ||
PseudoRET implicit $lr | ||
... | ||
|
||
--- | ||
name: test_fifo_st_push_544_conv_bfp16ebs8_to_bfp16ebs16 | ||
tracksRegLiveness: true | ||
legalized: true | ||
regBankSelected: true | ||
body: | | ||
bb.1.entry: | ||
liveins: $e0, $p0, $x0 | ||
; CHECK-LABEL: name: test_fifo_st_push_544_conv_bfp16ebs8_to_bfp16ebs16 | ||
; CHECK: liveins: $e0, $p0, $x0 | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: [[COPY:%[0-9]+]]:vec512 = COPY $x0 | ||
; CHECK-NEXT: [[COPY1:%[0-9]+]]:el = COPY $e0 | ||
; CHECK-NEXT: [[DEF:%[0-9]+]]:mpfs = IMPLICIT_DEF | ||
; CHECK-NEXT: [[DEF1:%[0-9]+]]:mstfifo = IMPLICIT_DEF | ||
; CHECK-NEXT: [[DEF2:%[0-9]+]]:mr26_fifo_st = IMPLICIT_DEF | ||
; CHECK-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vec576 = REG_SEQUENCE [[COPY]], %subreg.sub_bfp16_x, [[COPY1]], %subreg.sub_bfp16_e | ||
; CHECK-NEXT: [[VST_PUSH_544_CONV_bfp16ebs16_ebs8_:%[0-9]+]]:mstfifo, [[VST_PUSH_544_CONV_bfp16ebs16_ebs8_1:%[0-9]+]]:mpfs, [[VST_PUSH_544_CONV_bfp16ebs16_ebs8_2:%[0-9]+]]:mr26_fifo_st = VST_PUSH_544_CONV_bfp16ebs16_ebs8 [[DEF1]], [[REG_SEQUENCE]], [[DEF]], [[DEF2]], implicit-def $srf2bflags, implicit-def $srfifo_of, implicit $crf2bmask, implicit $crrnd | ||
; CHECK-NEXT: PseudoRET implicit $lr | ||
%0:ptrregbank(p0) = COPY $p0 | ||
%1:vregbank(<64 x s8>) = COPY $x0 | ||
%2:gprregbank(<8 x s8>) = COPY $e0 | ||
%3:ptrregbank(p0) = IMPLICIT_DEF | ||
%4:fiforegbank(<32 x s32>) = IMPLICIT_DEF | ||
%5:gprregbank(s32) = IMPLICIT_DEF | ||
%6:vregbank(<64 x s8>), %7:gprregbank(<8 x s8>) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.aie2p.v64bfp16ebs8.to.v64bfp16ebs16), %1(<64 x s8>), %2(<8 x s8>) | ||
%8:ptrregbank(p0), %9:fiforegbank(<32 x s32>), %10:gprregbank(s32) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.aie2p.fifo.st.push.544.bfp16), %3:ptrregbank(p0), %6:vregbank(<64 x s8>), %7:gprregbank(<8 x s8>), %4:fiforegbank(<32 x s32>), %5:gprregbank(s32) | ||
PseudoRET implicit $lr | ||
... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we also have to check, that there is only one user of DstReg, i.e. nobody is using the intermediate results of the conversion except for VST_PUSH?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we have to check, Iam checking that in AIE2PInstructionSelector.cpp