File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
test/Analysis/CostModel/AArch64 Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -3259,7 +3259,7 @@ InstructionCost AArch64TTIImpl::getVectorInstrCostHelper(
32593259 auto RegWidth =
32603260 getRegisterBitWidth (TargetTransformInfo::RGK_FixedWidthVector)
32613261 .getFixedValue ();
3262- return ( Idx == 0 || (Idx * EltSz) % RegWidth == 0 );
3262+ return Idx == 0 || (RegWidth != 0 && (Idx * EltSz) % RegWidth == 0 );
32633263 };
32643264
32653265 // Check if the type constraints on input vector type and result scalar type
Original file line number Diff line number Diff line change 1+ ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5
2+ ; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=aarch64-unknown-linux -mattr=+sme | FileCheck %s
3+
4+ define double @extract_case7 (<4 x double > %a ) "aarch64_pstate_sm_enabled" {
5+ ; CHECK-LABEL: 'extract_case7'
6+ ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %0 = extractelement <4 x double> %a, i32 1
7+ ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %1 = extractelement <4 x double> %a, i32 2
8+ ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = fmul double %0, %1
9+ ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret double %res
10+ ;
11+ entry:
12+ %1 = extractelement <4 x double > %a , i32 1
13+ %2 = extractelement <4 x double > %a , i32 2
14+ %res = fmul double %1 , %2
15+ ret double %res
16+ }
17+
18+ declare void @foo (double )
You can’t perform that action at this time.
0 commit comments