Opcode, Ty, CostKind, Op1Info, Op2Info);
if (Ty->isVectorTy()) {
if (TLI->isOperationLegalOrCustom(ISD, LT.second) && ST->hasSVE()) {
- // SDIV/UDIV operations are lowered, then we can have less costs.
+ // SDIV/UDIV operations are lowered using SVE, then we can have less
+ // costs.
if (isa<FixedVectorType>(Ty) &&
cast<FixedVectorType>(Ty)->getPrimitiveSizeInBits().getFixedSize() <
128) {
; Assuming base_cost = 2
; Assuming legalization_cost = (vec_len-1/VBITS)+1
-; Assuming extra cost of 8 for i8.
-; Assuming extra cost of 4 for i16.
-; The hard-coded expected cost is based on VBITS=128
+; For fixed-length vectors >= 128, if element type is i8, multiply the cost by 8.
+; For fixed-length vectors >= 128, if element type is i16, multiply the cost by 4.
define void @sdiv() #0 {
; CHECK-LABEL: function 'sdiv'
; Assuming base_cost = 2
; Assuming legalization_cost = (vec_len-1/VBITS)+1
-; Assuming extra cost of 8 for i8.
-; Assuming extra cost of 4 for i16.
-; The hard-coded expected cost is based on VBITS=128
+; For fixed-length vectors >= 128, if element type is i8, multiply the cost by 8.
+; For fixed-length vectors >= 128, if element type is i16, multiply the cost by 4.
define void @udiv() #0 {
; CHECK-LABEL: function 'udiv'