Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RISCV] Mark FSIN and other math functions as Expand for scalable vec…
…tors. This prevents them from being assumed legal by the cost model. This matches what is done for AArch64 SVE. Reviewed By: reames Differential Revision: https://reviews.llvm.org/D123799
- Loading branch information
Showing
2 changed files
with
63 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py | ||
; RUN: opt < %s -passes='print<cost-model>' 2>&1 -disable-output -S -mtriple=riscv64 -mattr=+v | FileCheck %s | ||
|
||
define void @unsupported_fp_ops(<vscale x 4 x float> %vec) { | ||
; CHECK-LABEL: 'unsupported_fp_ops' | ||
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %sin = call <vscale x 4 x float> @llvm.sin.nxv4f32(<vscale x 4 x float> %vec) | ||
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %cos = call <vscale x 4 x float> @llvm.cos.nxv4f32(<vscale x 4 x float> %vec) | ||
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %pow = call <vscale x 4 x float> @llvm.pow.nxv4f32(<vscale x 4 x float> %vec, <vscale x 4 x float> %vec) | ||
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %powi = call <vscale x 4 x float> @llvm.powi.nxv4f32.i32(<vscale x 4 x float> %vec, i32 42) | ||
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %exp = call <vscale x 4 x float> @llvm.exp.nxv4f32(<vscale x 4 x float> %vec) | ||
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %exp2 = call <vscale x 4 x float> @llvm.exp2.nxv4f32(<vscale x 4 x float> %vec) | ||
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %log = call <vscale x 4 x float> @llvm.log.nxv4f32(<vscale x 4 x float> %vec) | ||
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %log2 = call <vscale x 4 x float> @llvm.log2.nxv4f32(<vscale x 4 x float> %vec) | ||
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %log10 = call <vscale x 4 x float> @llvm.log10.nxv4f32(<vscale x 4 x float> %vec) | ||
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %rint = call <vscale x 4 x float> @llvm.rint.nxv4f32(<vscale x 4 x float> %vec) | ||
; CHECK-NEXT: Cost Model: Invalid cost for instruction: %nearbyint = call <vscale x 4 x float> @llvm.nearbyint.nxv4f32(<vscale x 4 x float> %vec) | ||
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void | ||
; | ||
|
||
%sin = call <vscale x 4 x float> @llvm.sin.nxv4f32(<vscale x 4 x float> %vec) | ||
%cos = call <vscale x 4 x float> @llvm.cos.nxv4f32(<vscale x 4 x float> %vec) | ||
%pow = call <vscale x 4 x float> @llvm.pow.nxv4f32(<vscale x 4 x float> %vec, <vscale x 4 x float> %vec) | ||
%powi = call <vscale x 4 x float> @llvm.powi.nxv4f32.i32(<vscale x 4 x float> %vec, i32 42) | ||
%exp = call <vscale x 4 x float> @llvm.exp.nxv4f32(<vscale x 4 x float> %vec) | ||
%exp2 = call <vscale x 4 x float> @llvm.exp2.nxv4f32(<vscale x 4 x float> %vec) | ||
%log = call <vscale x 4 x float> @llvm.log.nxv4f32(<vscale x 4 x float> %vec) | ||
%log2 = call <vscale x 4 x float> @llvm.log2.nxv4f32(<vscale x 4 x float> %vec) | ||
%log10 = call <vscale x 4 x float> @llvm.log10.nxv4f32(<vscale x 4 x float> %vec) | ||
%rint = call <vscale x 4 x float> @llvm.rint.nxv4f32(<vscale x 4 x float> %vec) | ||
%nearbyint = call <vscale x 4 x float> @llvm.nearbyint.nxv4f32(<vscale x 4 x float> %vec) | ||
ret void | ||
} | ||
|
||
declare <vscale x 4 x float> @llvm.sin.nxv4f32(<vscale x 4 x float>) | ||
declare <vscale x 4 x float> @llvm.cos.nxv4f32(<vscale x 4 x float>) | ||
declare <vscale x 4 x float> @llvm.pow.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>) | ||
declare <vscale x 4 x float> @llvm.powi.nxv4f32.i32(<vscale x 4 x float>, i32) | ||
declare <vscale x 4 x float> @llvm.exp.nxv4f32(<vscale x 4 x float>) | ||
declare <vscale x 4 x float> @llvm.exp2.nxv4f32(<vscale x 4 x float>) | ||
declare <vscale x 4 x float> @llvm.log.nxv4f32(<vscale x 4 x float>) | ||
declare <vscale x 4 x float> @llvm.log2.nxv4f32(<vscale x 4 x float>) | ||
declare <vscale x 4 x float> @llvm.log10.nxv4f32(<vscale x 4 x float>) | ||
declare <vscale x 4 x float> @llvm.rint.nxv4f32(<vscale x 4 x float>) | ||
declare <vscale x 4 x float> @llvm.nearbyint.nxv4f32(<vscale x 4 x float>) |