[PATCH] D80924: [CostModel] Use MaybeAlign in getMemoryOpCost

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 4 08:44:55 PDT 2020


arsenm added a comment.

In D80924#2073798 <https://reviews.llvm.org/D80924#2073798>, @samparker wrote:

> > We should remove MaybeAlign entirely. Nothing is ever truly missing the alignment, and Align(1) is always a acceptable degenerate value.
>
> Okay, so for my case where TTIImpl can't pass the object to BasicTTI, I could just check whether alignment is assigned, and if not, then just pass Align(1)?




In D80924#2073798 <https://reviews.llvm.org/D80924#2073798>, @samparker wrote:

> > We should remove MaybeAlign entirely. Nothing is ever truly missing the alignment, and Align(1) is always a acceptable degenerate value.
>
> Okay, so for my case where TTIImpl can't pass the object to BasicTTI, I could just check whether alignment is assigned, and if not, then just pass Align(1)?


Yes. The broken API before was that you were supposed to check the ABI type alignment if the alignment wasn't set on the load/store instruction. Those have been fixed, and there should be a shrinking number of contexts where the alignment is "missing"


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80924





More information about the llvm-commits mailing list