[PATCH] D121898: [Verifier] Verify parameter alignment.
Kan Shengchen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 17 20:51:49 PDT 2022
skan added inline comments.
================
Comment at: llvm/lib/IR/Verifier.cpp:1742
+ Align AttrAlign = Attr.getAlignment().valueOrOne();
+ // ArgFlagsTy::MemAlign only have 4 bits for alignment, so the
+ // alignment size should not exceed 1 << 14, otherwise it can NOT
----------------
A question: why is the max alignment is not 1<<15 if we have 4 bits?
================
Comment at: llvm/lib/IR/Verifier.cpp:3163
+ // be properly lowered.
+ Align MaxAlign(1 << 15);
+ Assert(ABIAlign < MaxAlign,
----------------
This is a little weird. We hard-code the max number by the width of a bit field...
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121898/new/
https://reviews.llvm.org/D121898
More information about the llvm-commits
mailing list