llvm-project
e21759ff - [BasicAA] Fix assertion failure in alias() caused by non-pointer base in DecomposeGEPExpression (#191180)

Commit
2 days ago
[BasicAA] Fix assertion failure in alias() caused by non-pointer base in DecomposeGEPExpression (#191180) When stripping a bitcast in DecomposeGEPExpression, the resulting operand may have a non-scalar-pointer type (e.g. <1 x ptr>). Proceeding with such a type as the decomposition base violates the AA assumption that all pointers are scalar pointer types, triggering an assertion failure on alias() call. Add a type check in the bitcast/addrspacecast handling path to return not stripped V as base when the stripped operand is not a scalar pointer type. Add a lit test verifying no crash on valid IR containing such a bitcast, and checking that the alias query conservatively returns MayAlias. Fixes #191157
Author
Parents
Loading