================
@@ -809,7 +809,13 @@ uint64_t IntType::getABIAlignment(const mlir::DataLayout
&dataLayout,
std::min(llvm::PowerOf2Ceil(width), static_cast<uint64_t>(64));
return std::max(alignBits / 8, static_cast<uint64_t>(1));
}
- return (uint64_t)(width / 8);
+ // Round up to a power-of-two byte alignment. DataLayout consumers such as
+ // llvm::Align require power-of-two alignments, and width / 8 is not a power
+ // of two for non-fundamental widths (e.g. i24 -> 3). This leaves the
----------------
andykaylor wrote:
Can we ever get an i24 value that isn't a BitInt apart from hand-written tests?
This is probably a good fallback to have anyway (as demonstrated by the fact
that you ran into it in your ABI work), but it seems like an odd case.
https://github.com/llvm/llvm-project/pull/210187
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits