[llvm] d056c0c - Remove unnecessary check for inalloca in IPConstantPropagation

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Tue May 5 08:26:20 PDT 2020


Author: Arthur Eubanks
Date: 2020-05-05T08:26:11-07:00
New Revision: d056c0c71f954b01e2d4475b8d75ec32e842fc00

URL: https://github.com/llvm/llvm-project/commit/d056c0c71f954b01e2d4475b8d75ec32e842fc00
DIFF: https://github.com/llvm/llvm-project/commit/d056c0c71f954b01e2d4475b8d75ec32e842fc00.diff

LOG: Remove unnecessary check for inalloca in IPConstantPropagation

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

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/IPConstantPropagation.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp b/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp
index a2d7bccadd37..8d05a72d68da 100644
--- a/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp
+++ b/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp
@@ -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();


        


More information about the llvm-commits mailing list