[clang] [Clang][AArch64] Fixed incorrect _BitInt alignment (PR #90602)
Eli Friedman via cfe-commits
cfe-commits at lists.llvm.org
Sun May 5 13:21:40 PDT 2024
================
@@ -518,6 +518,16 @@ class TargetInfo : public TransferrableTargetInfo,
/// getInt128Align() - Returns the alignment of Int128.
unsigned getInt128Align() const { return Int128Align; }
+ /// getBitIntAlign/Width - Return aligned size of '_BitInt' and
+ /// 'unsigned _BitInt' for this target, in bits.
+ unsigned getBitIntWidth(unsigned NumBits) const {
+ return llvm::alignTo(NumBits, getBitIntAlign(NumBits));
+ }
+ virtual unsigned getBitIntAlign(unsigned NumBits) const {
----------------
efriedma-quic wrote:
Instead of making this virtual, maybe it makes sense to add a field `std::optional<unsigned> BitIntMaxAlign` to TargetInfo? I expect the logic here besides the max width to be consistent across all targets.
https://github.com/llvm/llvm-project/pull/90602
More information about the cfe-commits
mailing list