Revert r187191, which broke opt -mem2reg on the testcases included in PR16867.

However, opt -O2 doesn't run mem2reg directly so nobody noticed until r188146
when SROA started sending more things directly down the PromoteMemToReg path.

In order to revert r187191, I also revert dependent revisions r187296, r187322
and r188146. Fixes PR16867. Does not add the testcases from that PR, but both
of them should get added for both mem2reg and sroa when this revert gets
unreverted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188327 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky
2013-08-13 22:51:58 +00:00
parent 0fe3792a2f
commit 6c1fa7caae
7 changed files with 166 additions and 323 deletions
@@ -20,7 +20,6 @@
namespace llvm {
class AllocaInst;
class DataLayout;
class DominatorTree;
class AliasSetTracker;
@@ -30,7 +29,7 @@ class AliasSetTracker;
/// (transitively) using this alloca. This also enforces that there is only
/// ever one layer of bitcasts or GEPs between the alloca and the lifetime
/// markers.
bool isAllocaPromotable(const AllocaInst *AI, const DataLayout *DL);
bool isAllocaPromotable(const AllocaInst *AI);
/// \brief Promote the specified list of alloca instructions into scalar
/// registers, inserting PHI nodes as appropriate.
@@ -42,7 +41,7 @@ bool isAllocaPromotable(const AllocaInst *AI, const DataLayout *DL);
/// If AST is specified, the specified tracker is updated to reflect changes
/// made to the IR.
void PromoteMemToReg(ArrayRef<AllocaInst *> Allocas, DominatorTree &DT,
const DataLayout *DL, AliasSetTracker *AST = 0);
AliasSetTracker *AST = 0);
} // End llvm namespace