Remove unnecessary check for inalloca in IPConstantPropagation
authorArthur Eubanks <aeubanks@google.com>
Mon, 4 May 2020 17:37:38 +0000 (10:37 -0700)
committerArthur Eubanks <aeubanks@google.com>
Tue, 5 May 2020 15:26:11 +0000 (08:26 -0700)
Summary:
This was added in https://reviews.llvm.org/D2449, but I'm not sure it's
necessary since an inalloca value is never a Constant (should be an
AllocaInst).

Reviewers: hans, rnk

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79350

llvm/lib/Transforms/IPO/IPConstantPropagation.cpp

index a2d7bcc..8d05a72 100644 (file)
@@ -129,7 +129,7 @@ static bool PropagateConstantsIntoArguments(Function &F) {
   for (unsigned i = 0, e = ArgumentConstants.size(); i != e; ++i, ++AI) {
     // Do we have a constant argument?
     if (ArgumentConstants[i].getInt() || AI->use_empty() ||
-        AI->hasInAllocaAttr() || (AI->hasByValAttr() && !F.onlyReadsMemory()))
+        (AI->hasByValAttr() && !F.onlyReadsMemory()))
       continue;
 
     Value *V = ArgumentConstants[i].getPointer();