Skip to content

Commit 14dee0a

Browse files
committed
[NewGVN] Avoid AA query on non-pointers (NFCI)
In order for the instruction result to alias with the pointer it needs to be a pointer.
1 parent 91e1922 commit 14dee0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/Scalar/NewGVN.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,7 @@ NewGVN::performSymbolicLoadCoercion(Type *LoadType, Value *LoadPtr,
15331533
// All of the below are only true if the loaded pointer is produced
15341534
// by the dependent instruction.
15351535
if (LoadPtr != lookupOperandLeader(DepInst) &&
1536-
!AA->isMustAlias(LoadPtr, DepInst))
1536+
DepInst->getType()->isPointerTy() && !AA->isMustAlias(LoadPtr, DepInst))
15371537
return nullptr;
15381538
// If this load really doesn't depend on anything, then we must be loading an
15391539
// undef value. This can happen when loading for a fresh allocation with no

0 commit comments

Comments
 (0)