[PATCH] D57449: GlobalISel: Add alignment to LegalityQuery MMOs

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 7 14:52:54 PST 2019


dsanders added a comment.

In D57449#1388378 <https://reviews.llvm.org/D57449#1388378>, @aemerson wrote:

> @dsanders does this look ok to you?


This looks sensible to me. I agree with adding it to the existing type as most targets will want to be checking alignment here and the few that don't can just check against alignment 1.

>From my side, there's just the one nit that Amara didn't already raise which is the truncation of the getAlignment() result. We should probably just store the uint64_t (and hope the optimizer is smart enough to inline it into the lambda). If we're going to do the truncate we should have an assert guard against overflow.



================
Comment at: lib/CodeGen/GlobalISel/LegalizerInfo.cpp:429
+         MMO->getOrdering(),
+         static_cast<unsigned>(MMO->getAlignment() * 8)});
 
----------------
Why the static cast?


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

https://reviews.llvm.org/D57449





More information about the llvm-commits mailing list