[ValueTracking] Correctly check addrspace of alloca
authorNikita Popov <npopov@redhat.com>
Fri, 23 Jun 2023 11:08:46 +0000 (13:08 +0200)
committerNikita Popov <npopov@redhat.com>
Fri, 23 Jun 2023 11:11:28 +0000 (13:11 +0200)
commita68c9687556696522e0d3ee62857714250d58a93
tree37469e525deac9d6a0a7284eb2fab553228e1e8b
parent63342ae4b8f7573fd03fdb6eb38d55097b9a6922
[ValueTracking] Correctly check addrspace of alloca

The DataLayout alloca address space is the address space that should
be used when creating new allocas. However, not all allocas are
required to be in this address space. The isKnownNonZero() check
should work on the actual address space of the alloca, not the
default alloca address space.
llvm/lib/Analysis/ValueTracking.cpp
llvm/test/Transforms/InstCombine/alloca-in-non-alloca-as.ll