aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/llvm-reduce/deltas/ReduceInstructions.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/tools/llvm-reduce/deltas/ReduceInstructions.cpp b/llvm/tools/llvm-reduce/deltas/ReduceInstructions.cpp
index f1f5d6b..19b69e8 100644
--- a/llvm/tools/llvm-reduce/deltas/ReduceInstructions.cpp
+++ b/llvm/tools/llvm-reduce/deltas/ReduceInstructions.cpp
@@ -13,6 +13,8 @@
#include "ReduceInstructions.h"
#include "Utils.h"
+#include "llvm/IR/Constants.h"
+#include "llvm/IR/Instructions.h"
using namespace llvm;
@@ -37,7 +39,9 @@ void llvm::reduceInstructionsDeltaPass(Oracle &O, ReducerWorkItem &WorkItem) {
for (auto &Inst :
make_early_inc_range(make_range(BB.begin(), std::prev(BB.end())))) {
if (!shouldAlwaysKeep(Inst) && !O.shouldKeep()) {
- Inst.replaceAllUsesWith(getDefaultValue(Inst.getType()));
+ Inst.replaceAllUsesWith(isa<AllocaInst>(Inst)
+ ? PoisonValue::get(Inst.getType())
+ : getDefaultValue(Inst.getType()));
Inst.eraseFromParent();
}
}