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

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 7 15:57:42 PST 2019


arsenm marked an inline comment as done.
arsenm added a comment.

I'm not sure why the MMO alignment is uint64_t in the first place. The maximum supported alignment is 1 << 29 (which I guess when converted to bits is 1 too many for uint32)



================
Comment at: lib/CodeGen/GlobalISel/LegalizerInfo.cpp:429
+         MMO->getOrdering(),
+         static_cast<unsigned>(MMO->getAlignment() * 8)});
 
----------------
dsanders wrote:
> Why the static cast?
LegalizerInfo.cpp:429:10: error: non-constant-expression cannot be narrowed from type 'unsigned long long' to 'uint32_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]
         MMO->getAlignment() * 8});
         ^~~~~~~~~~~~~~~~~~~~~~~
../lib/CodeGen/GlobalISel/LegalizerInfo.cpp:429:10: note: insert an explicit cast to silence this issue
         MMO->getAlignment() * 8});
         ^~~~~~~~~~~~~~~~~~~~~~~
         static_cast<uint32_t>( )



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

https://reviews.llvm.org/D57449





More information about the llvm-commits mailing list