[PATCH] D110634: [llvm] Update IR verifier to reject non-power-of-2 alignment assume bundles (PR48713).
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 28 11:11:23 PDT 2021
nikic added inline comments.
================
Comment at: llvm/lib/IR/Verifier.cpp:4668
+ dyn_cast<ConstantInt>(Call.getOperand(Elem.Begin + 1));
+ if (Alignment)
+ Assert(Alignment->getValue().isPowerOf2(),
----------------
I believe this should be `Assert(Alignment && Alignment->getValue().isPowerOf2())`. That is, we should be requiring the alignment to be a constant. I don't think it makes sense to enforce power of two only for constant alignments, but leave non-constant alignments unconstrained -- and non-constant alignments don't really make sense to me in this context.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110634/new/
https://reviews.llvm.org/D110634
More information about the llvm-commits
mailing list