forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RISCV][GISEL] Add support for scalable vector types in lowerReturnVal
Scalable vector types from LLVM IR are lowered into physical vector registers in MIR based on calling convention. This patch is stacked on llvm#70881.
- Loading branch information
1 parent
a1a77bb
commit 16a10c3
Showing
7 changed files
with
850 additions
and
3 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
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
14 changes: 14 additions & 0 deletions
14
llvm/test/CodeGen/RISCV/GlobalISel/irtranslator/vec-ret-bf16-err.ll
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,14 @@ | ||
; RUN: not --crash llc -mtriple=riscv32 -mattr=+v -global-isel -stop-after=irtranslator \ | ||
; RUN: -verify-machineinstrs < %s 2>&1 | FileCheck %s | ||
; RUN: not --crash llc -mtriple=riscv64 -mattr=+v -global-isel -stop-after=irtranslator \ | ||
; RUN: -verify-machineinstrs < %s 2>&1 | FileCheck %s | ||
|
||
; The purpose of this test is to show that the compiler throws an error when | ||
; there is no support for bf16 vectors. If the compiler did not throw an error, | ||
; then it will try to scalarize the argument to an s32, which may drop elements. | ||
define <vscale x 1 x bfloat> @test_ret_nxv1bf16() { | ||
entry: | ||
ret <vscale x 1 x bfloat> undef | ||
} | ||
|
||
; CHECK: LLVM ERROR: unable to translate instruction: ret (in function: test_ret_nxv1bf16) |
14 changes: 14 additions & 0 deletions
14
llvm/test/CodeGen/RISCV/GlobalISel/irtranslator/vec-ret-f16-err.ll
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,14 @@ | ||
; RUN: not --crash llc -mtriple=riscv32 -mattr=+v -global-isel -stop-after=irtranslator \ | ||
; RUN: -verify-machineinstrs < %s 2>&1 | FileCheck %s | ||
; RUN: not --crash llc -mtriple=riscv64 -mattr=+v -global-isel -stop-after=irtranslator \ | ||
; RUN: -verify-machineinstrs < %s 2>&1 | FileCheck %s | ||
|
||
; The purpose of this test is to show that the compiler throws an error when | ||
; there is no support for f16 vectors. If the compiler did not throw an error, | ||
; then it will try to scalarize the argument to an s32, which may drop elements. | ||
define <vscale x 1 x half> @test_ret_nxv1f16() { | ||
entry: | ||
ret <vscale x 1 x half> undef | ||
} | ||
|
||
; CHECK: LLVM ERROR: unable to translate instruction: ret (in function: test_ret_nxv1f16) |
Oops, something went wrong.