<div dir="ltr"><div>Hi,</div><div><br></div><div>Looking through constant folding code, we currently have an assumption that GlobalAliases may be null: <a href="https://github.com/llvm/llvm-project/blob/df69c69427dea7f5b3b3a4d4564bc77b0926ec88/llvm/lib/IR/ConstantFold.cpp#L1764">https://github.com/llvm/llvm-project/blob/df69c69427dea7f5b3b3a4d4564bc77b0926ec88/llvm/lib/IR/ConstantFold.cpp#L1764</a></div><div><br></div><div>However, it's not really clear to me under which circumstances this can happen. LLVM only allows aliases to definitions, not declarations, so an alias to an extern_weak symbol is not possible. LLVM supports weak aliases, but as far as I understand, these also cannot be null (as at least the aliased symbol is definitely defined, and will be used if there is no definition of the alias itself).</div><div><br></div><div>Is this an outdated check, or am I missing something?<br></div><div><br></div><div>Regards,<br></div><div>Nikita<br></div></div>