mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Update BasicAliasAnalysis to understand that nothing aliases with undef values.
It got this in some cases (if one of them was an identified object), but not in all cases. This caused stores to undef to block load-forwarding in some cases, etc. Added test to Transforms/GVN to verify optimization occurs as expected. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236511 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1389,6 +1389,11 @@ BasicAliasAnalysis::aliasCheck(const Value *V1, uint64_t V1Size,
|
||||
V1 = V1->stripPointerCasts();
|
||||
V2 = V2->stripPointerCasts();
|
||||
|
||||
// If V1 or V2 is undef, the result is NoAlias because we can always pick a
|
||||
// value for undef that aliases nothing in the program.
|
||||
if (isa<UndefValue>(V1) || isa<UndefValue>(V2))
|
||||
return NoAlias;
|
||||
|
||||
// Are we checking for alias of the same value?
|
||||
// Because we look 'through' phi nodes we could look at "Value" pointers from
|
||||
// different iterations. We must therefore make sure that this is not the
|
||||
|
Reference in New Issue
Block a user