[PATCH] D94946: [ARM] Expand vXi1 VSELECT's

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 19 05:37:34 PST 2021


SjoerdMeijer accepted this revision.
SjoerdMeijer added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/test/Analysis/CostModel/ARM/arith-overflow.ll:387
 ; MVE-RECIP-NEXT:  Cost Model: Found an estimated cost of 74 for instruction: %V2I64 = call { <2 x i64>, <2 x i1> } @llvm.ssub.with.overflow.v2i64(<2 x i64> undef, <2 x i64> undef)
-; MVE-RECIP-NEXT:  Cost Model: Found an estimated cost of 166 for instruction: %V4I64 = call { <4 x i64>, <4 x i1> } @llvm.ssub.with.overflow.v4i64(<4 x i64> undef, <4 x i64> undef)
-; MVE-RECIP-NEXT:  Cost Model: Found an estimated cost of 582 for instruction: %V8I64 = call { <8 x i64>, <8 x i1> } @llvm.ssub.with.overflow.v8i64(<8 x i64> undef, <8 x i64> undef)
+; MVE-RECIP-NEXT:  Cost Model: Found an estimated cost of 242 for instruction: %V4I64 = call { <4 x i64>, <4 x i1> } @llvm.ssub.with.overflow.v4i64(<4 x i64> undef, <4 x i64> undef)
+; MVE-RECIP-NEXT:  Cost Model: Found an estimated cost of 866 for instruction: %V8I64 = call { <8 x i64>, <8 x i1> } @llvm.ssub.with.overflow.v8i64(<8 x i64> undef, <8 x i64> undef)
----------------
dmgreen wrote:
> SjoerdMeijer wrote:
> > More of a curiosity, how was this lowered before? Given the added codegen tests, I guess this is not only a cost-model tweak? And some of these costs are extremely high. Do they make sense?
> Yep. The costs are based on whether the operation is legal and add.with.overflow checks the cost of selects of predicates (v4i1). There is no legal instruction for them for MVE, so a high cost is probably fine.
> 
> D94958 updates the similar costs for sadd.sat and friends, which also have costs based in sadd.with.overflow by default.
> Yep. The costs are based on whether the operation is legal and add.with.overflow checks the cost of selects of predicates (v4i1). There is no legal instruction for them for MVE, so a high cost is probably fine.
> 
> D94958 updates the similar costs for sadd.sat and friends, which also have costs based in sadd.with.overflow by default.

Yeah, thanks, now this is more consistent with each other; I was asking because of this difference.

LGTM


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94946/new/

https://reviews.llvm.org/D94946



More information about the llvm-commits mailing list