[PATCH] D78922: [CostModel] Remove getExtCost

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 20 23:06:06 PDT 2020


samparker marked an inline comment as done.
samparker added inline comments.


================
Comment at: llvm/test/Analysis/CostModel/AArch64/cast.ll:30
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %r23 = trunc i32 undef to i16
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %r24 = sext i32 undef to i64
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %r24 = sext i32 undef to i64
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %r25 = zext i32 undef to i64
----------------
dmgreen wrote:
> Also, and I may be forgetting something because I thought these looked fine the last time I looked, but why would a sext i32->i64 be free? Would it not need a sxtw?
We would, this confused me too. AArch64 looks at all the users of the cast and in the case of no users in returns 0!  So it completely breaks these tests. I've haven't given enough context to this patch, because I've also added another cast test with users and that hasn't changed.


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

https://reviews.llvm.org/D78922





More information about the llvm-commits mailing list