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
if (const StoreInst *SI = dyn_cast<StoreInst>(L)) {
Metadata for store instructions (including TBAA) isn't compared in function comparator. This may lead to merging functions with different TBAA metadata. This means breaking further optimizations based on TBAA, including removing loads and stores wrongly assumed to be redundant and optimized-out.
Functions BStore and AStore have almost identical code - they store a value in memory, but using different TBAA tags - for i64 and u64 language types (which are in my language distinct from each other).
After running optimization passes (including functions merge pass) I get following code:
Two functions were merged, but this is incorrect behavior. In such example it's not a big deal, but in cases where such functions may be inlined later this may cause a bug leading to miscompilation and crashes in result binary code.
The text was updated successfully, but these errors were encountered:
See
llvm-project/llvm/lib/Transforms/Utils/FunctionComparator.cpp
Line 698 in 58326f1
Metadata for
store
instructions (including TBAA) isn't compared in function comparator. This may lead to merging functions with different TBAA metadata. This means breaking further optimizations based on TBAA, including removing loads and stores wrongly assumed to be redundant and optimized-out.Example generated by my language compiler:
Functions
BStore
andAStore
have almost identical code - they store a value in memory, but using different TBAA tags - fori64
andu64
language types (which are in my language distinct from each other).After running optimization passes (including functions merge pass) I get following code:
Two functions were merged, but this is incorrect behavior. In such example it's not a big deal, but in cases where such functions may be inlined later this may cause a bug leading to miscompilation and crashes in result binary code.
The text was updated successfully, but these errors were encountered: