Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CostModel]Replace FixedVectorType by VectorType in costgetIntrinsicI…
…nstrCost This patch replaces FixedVectorType by VectorType in getIntrinsicInstrCost in BasicTTIImpl.h. It re-arranges the scalable type test earlier return and add tests for scalable types. Depends on D91532 Differential Revision: https://reviews.llvm.org/D92094
- Loading branch information
1 parent
dad07ba
commit 60e4698
Showing
2 changed files
with
47 additions
and
4 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
33 changes: 33 additions & 0 deletions
33
llvm/test/Analysis/CostModel/AArch64/sve-getIntrinsicInstrCost-cctz-ctlz.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,33 @@ | ||
; Checks getIntrinsicInstrCost in BasicTTIImpl.h with SVE for CTLZ and CCTZ | ||
|
||
; RUN: opt -cost-model -analyze -mtriple=aarch64--linux-gnu -mattr=+sve < %s 2>%t | FileCheck %s | ||
|
||
; RUN: FileCheck --check-prefix=WARN --allow-empty %s <%t | ||
|
||
; If this check fails please read test/CodeGen/AArch64/README for instructions on how to resolve it. | ||
; WARN-NOT: warning | ||
|
||
; Check for CTLZ | ||
|
||
define void @ctlz_nxv4i32(<vscale x 4 x i32> %A) { | ||
; CHECK-LABEL: 'ctlz_nxv4i32' | ||
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = tail call <vscale x 4 x i32> @llvm.ctlz.nxv4i32(<vscale x 4 x i32> %A, i1 true) | ||
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void | ||
|
||
%1 = tail call <vscale x 4 x i32> @llvm.ctlz.nxv4i32(<vscale x 4 x i32> %A, i1 true) | ||
ret void | ||
} | ||
|
||
; Check for CCTZ | ||
|
||
define void @cttz_nxv4i32(<vscale x 4 x i32> %A) { | ||
; CHECK-LABEL: 'cttz_nxv4i32' | ||
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = tail call <vscale x 4 x i32> @llvm.cttz.nxv4i32(<vscale x 4 x i32> %A, i1 true) | ||
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void | ||
|
||
%1 = tail call <vscale x 4 x i32> @llvm.cttz.nxv4i32(<vscale x 4 x i32> %A, i1 true) | ||
ret void | ||
} | ||
|
||
declare <vscale x 4 x i32> @llvm.ctlz.nxv4i32(<vscale x 4 x i32>, i1) | ||
declare <vscale x 4 x i32> @llvm.cttz.nxv4i32(<vscale x 4 x i32>, i1) |