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 | dc4ffef633d559e2061a68a7723874a8570290f7 (patch) | |
| tree | 06ee83fc5db725f69328cb27ba4f72bedb6faa06 /llvm/lib/Transforms | |
| parent | 6299905a069c3217e7a061e497cc50550ba5c872 (diff) | |
| download | bcm5719-llvm-dc4ffef633d559e2061a68a7723874a8570290f7.tar.gz bcm5719-llvm-dc4ffef633d559e2061a68a7723874a8570290f7.zip | |
Fix a bug where we didn't realize that vaarg reads memory. This fixes
Transforms/DeadStoreElimination/2005-11-30-vaarg.ll
llvm-svn: 24545
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp index 07d5c655205..d3f461d3182 100644 --- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/llvm/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); |

