-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AIE2P] Legalize G_TRUNC for vector types
- Loading branch information
Showing
6 changed files
with
233 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
135 changes: 135 additions & 0 deletions
135
llvm/test/CodeGen/AIE/aie2p/GlobalIsel/legalize-trunc.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
# 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=legalizer %s -verify-machineinstrs -o - | FileCheck %s | ||
|
||
|
||
--- | ||
name: v16s32_trunc_v16s64_acc1024 | ||
body: | | ||
bb.1.entry: | ||
; CHECK-LABEL: name: v16s32_trunc_v16s64_acc1024 | ||
; CHECK: [[DEF:%[0-9]+]]:_(<16 x s64>) = G_IMPLICIT_DEF | ||
; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(<16 x s32>) = G_TRUNC [[DEF]](<16 x s64>) | ||
; CHECK-NEXT: PseudoRET implicit $lr, implicit [[TRUNC]](<16 x s32>) | ||
%1:_(<16 x s64>) = G_IMPLICIT_DEF | ||
%0:_(<16 x s32>) = G_TRUNC %1(<16 x s64>) | ||
PseudoRET implicit $lr, implicit %0 | ||
... | ||
--- | ||
name: v32s16_trunc_v32s32_acc1024 | ||
body: | | ||
bb.1.entry: | ||
; CHECK-LABEL: name: v32s16_trunc_v32s32_acc1024 | ||
; CHECK: [[DEF:%[0-9]+]]:_(<32 x s32>) = G_IMPLICIT_DEF | ||
; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(<32 x s16>) = G_TRUNC [[DEF]](<32 x s32>) | ||
; CHECK-NEXT: PseudoRET implicit $lr, implicit [[TRUNC]](<32 x s16>) | ||
%1:_(<32 x s32>) = G_IMPLICIT_DEF | ||
%0:_(<32 x s16>) = G_TRUNC %1(<32 x s32>) | ||
PseudoRET implicit $lr, implicit %0 | ||
... | ||
--- | ||
name: v8s32_trunc_v8s64_acc512 | ||
body: | | ||
bb.1.entry: | ||
; CHECK-LABEL: name: v8s32_trunc_v8s64_acc512 | ||
; CHECK: [[DEF:%[0-9]+]]:_(<8 x s64>) = G_IMPLICIT_DEF | ||
; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(<8 x s32>) = G_TRUNC [[DEF]](<8 x s64>) | ||
; CHECK-NEXT: PseudoRET implicit $lr, implicit [[TRUNC]](<8 x s32>) | ||
%1:_(<8 x s64>) = G_IMPLICIT_DEF | ||
%0:_(<8 x s32>) = G_TRUNC %1(<8 x s64>) | ||
PseudoRET implicit $lr, implicit %0 | ||
... | ||
--- | ||
name: v16s16_trunc_v16s32_acc512 | ||
body: | | ||
bb.1.entry: | ||
; CHECK-LABEL: name: v16s16_trunc_v16s32_acc512 | ||
; CHECK: [[DEF:%[0-9]+]]:_(<16 x s32>) = G_IMPLICIT_DEF | ||
; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(<16 x s16>) = G_TRUNC [[DEF]](<16 x s32>) | ||
; CHECK-NEXT: PseudoRET implicit $lr, implicit [[TRUNC]](<16 x s16>) | ||
%1:_(<16 x s32>) = G_IMPLICIT_DEF | ||
%0:_(<16 x s16>) = G_TRUNC %1(<16 x s32>) | ||
PseudoRET implicit $lr, implicit %0 | ||
... | ||
--- | ||
name: v32s16_trunc_v32s32_vec1024 | ||
body: | | ||
bb.1.entry: | ||
; CHECK-LABEL: name: v32s16_trunc_v32s32_vec1024 | ||
; CHECK: [[DEF:%[0-9]+]]:_(<32 x s32>) = G_IMPLICIT_DEF | ||
; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(<32 x s16>) = G_TRUNC [[DEF]](<32 x s32>) | ||
; CHECK-NEXT: PseudoRET implicit $lr, implicit [[TRUNC]](<32 x s16>) | ||
%1:_(<32 x s32>) = G_IMPLICIT_DEF | ||
%0:_(<32 x s16>) = G_TRUNC %1(<32 x s32>) | ||
PseudoRET implicit $lr, implicit %0 | ||
... | ||
--- | ||
name: v64s8_trunc_v64s16_vec1024 | ||
body: | | ||
bb.1.entry: | ||
; CHECK-LABEL: name: v64s8_trunc_v64s16_vec1024 | ||
; CHECK: [[DEF:%[0-9]+]]:_(<64 x s16>) = G_IMPLICIT_DEF | ||
; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(<64 x s8>) = G_TRUNC [[DEF]](<64 x s16>) | ||
; CHECK-NEXT: PseudoRET implicit $lr, implicit [[TRUNC]](<64 x s8>) | ||
%1:_(<64 x s16>) = G_IMPLICIT_DEF | ||
%0:_(<64 x s8>) = G_TRUNC %1(<64 x s16>) | ||
PseudoRET implicit $lr, implicit %0 | ||
... | ||
--- | ||
name: v16s16_trunc_v16s32_vec512 | ||
body: | | ||
bb.1.entry: | ||
; CHECK-LABEL: name: v16s16_trunc_v16s32_vec512 | ||
; CHECK: [[DEF:%[0-9]+]]:_(<16 x s32>) = G_IMPLICIT_DEF | ||
; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(<16 x s16>) = G_TRUNC [[DEF]](<16 x s32>) | ||
; CHECK-NEXT: PseudoRET implicit $lr, implicit [[TRUNC]](<16 x s16>) | ||
%1:_(<16 x s32>) = G_IMPLICIT_DEF | ||
%0:_(<16 x s16>) = G_TRUNC %1(<16 x s32>) | ||
PseudoRET implicit $lr, implicit %0 | ||
... | ||
--- | ||
name: v32s8_trunc_v32s16_vec512 | ||
body: | | ||
bb.1.entry: | ||
; CHECK-LABEL: name: v32s8_trunc_v32s16_vec512 | ||
; CHECK: [[DEF:%[0-9]+]]:_(<32 x s16>) = G_IMPLICIT_DEF | ||
; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(<32 x s8>) = G_TRUNC [[DEF]](<32 x s16>) | ||
; CHECK-NEXT: PseudoRET implicit $lr, implicit [[TRUNC]](<32 x s8>) | ||
%1:_(<32 x s16>) = G_IMPLICIT_DEF | ||
%0:_(<32 x s8>) = G_TRUNC %1(<32 x s16>) | ||
PseudoRET implicit $lr, implicit %0 | ||
... | ||
--- | ||
name: v32s32_trunc_v32s64_acc2048 | ||
body: | | ||
bb.1.entry: | ||
; CHECK-LABEL: name: v32s32_trunc_v32s64_acc2048 | ||
; CHECK: [[DEF:%[0-9]+]]:_(<32 x s64>) = G_IMPLICIT_DEF | ||
; CHECK-NEXT: [[UV:%[0-9]+]]:_(<16 x s64>), [[UV1:%[0-9]+]]:_(<16 x s64>) = G_UNMERGE_VALUES [[DEF]](<32 x s64>) | ||
; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(<16 x s32>) = G_TRUNC [[UV]](<16 x s64>) | ||
; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(<16 x s32>) = G_TRUNC [[UV1]](<16 x s64>) | ||
; CHECK-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:_(<32 x s32>) = G_CONCAT_VECTORS [[TRUNC]](<16 x s32>), [[TRUNC1]](<16 x s32>) | ||
; CHECK-NEXT: PseudoRET implicit $lr, implicit [[CONCAT_VECTORS]](<32 x s32>) | ||
%1:_(<32 x s64>) = G_IMPLICIT_DEF | ||
%0:_(<32 x s32>) = G_TRUNC %1(<32 x s64>) | ||
PseudoRET implicit $lr, implicit %0 | ||
... | ||
--- | ||
name: v16s8_trunc_v16s16_vec256 | ||
body: | | ||
bb.1.entry: | ||
; CHECK-LABEL: name: v16s8_trunc_v16s16_vec256 | ||
; CHECK: [[DEF:%[0-9]+]]:_(<16 x s16>) = G_IMPLICIT_DEF | ||
; CHECK-NEXT: [[AIE_PAD_VECTOR_UNDEF:%[0-9]+]]:_(<32 x s16>) = G_AIE_PAD_VECTOR_UNDEF [[DEF]](<16 x s16>) | ||
; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(<32 x s8>) = G_TRUNC [[AIE_PAD_VECTOR_UNDEF]](<32 x s16>) | ||
; CHECK-NEXT: [[AIE_UNPAD_VECTOR:%[0-9]+]]:_(<16 x s8>) = G_AIE_UNPAD_VECTOR [[TRUNC]](<32 x s8>) | ||
; CHECK-NEXT: PseudoRET implicit $lr, implicit [[AIE_UNPAD_VECTOR]](<16 x s8>) | ||
%1:_(<16 x s16>) = G_IMPLICIT_DEF | ||
%0:_(<16 x s8>) = G_TRUNC %1(<16 x s16>) | ||
PseudoRET implicit $lr, implicit %0 | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters