diff options
author | Chris Lattner <sabre@nondot.org> | 2005-11-30 19:38:22 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-11-30 19:38:22 +0000 |
commit | 2bd4cb597a58d0a8f1ff332c2f50ed8232cc5898 (patch) | |
tree | 92c6a1d513f43fde80e35cf7ca9232ab5013298f /lib/Transforms | |
parent | c2c2009e2c9da175f293a8e053cd7b231deeb687 (diff) |
Fix a bug where we didn't realize that vaarg reads memory. This fixes
Transforms/DeadStoreElimination/2005-11-30-vaarg.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24545 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/DeadStoreElimination.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/DeadStoreElimination.cpp b/lib/Transforms/Scalar/DeadStoreElimination.cpp index 07d5c65520..d3f461d318 100644 --- a/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -96,6 +96,13 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) { } if (!isa<StoreInst>(I) || cast<StoreInst>(I)->isVolatile()) { + // If this is a vaarg instruction, it reads its operand. We don't model + // it correctly, so just conservatively remove all entries. + if (isa<VAArgInst>(I)) { + KillLocs.clear(); + continue; + } + // If this is a non-store instruction, it makes everything referenced no // longer killed. Remove anything aliased from the alias set tracker. KillLocs.remove(I); |