You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A recent version of LLVM removed implicit alignments from alloca, load, and store. This means that an "align n" must be present on those instructions, although one will be automatically generated by LLVMBuildAlloca and similar instructions. As part of this, LLVM changed the behavior of LLVMSetAlignment to wrap the alignment in an Align rather than a MaybeAlign. As a result, when an alignment 0 is explicitly set, LLVM assumes it is greater than 0 and takes the log2 of it. The shortcut algorithm for log2 (e.g. 31 - leading zero bit count) results in an overflow when the alignment is 0. This causes the module verifier to fail.
Solution: Let the default alignment be calculated and don't explicitly set it when no explicit alignment is specified.
0 commit comments