summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/SSAUpdater.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2010-11-16 17:41:24 +0000
committerDuncan Sands <baldrick@free.fr>2010-11-16 17:41:24 +0000
commit637049515fa392383a8ffbb79839d510986ab939 (patch)
tree8e5516f90b007bec3b4a1acb434f8483e81c5d8d /llvm/lib/Transforms/Utils/SSAUpdater.cpp
parenta2307543854e0a825d8c1975b1e3db64d71ea949 (diff)
downloadbcm5719-llvm-637049515fa392383a8ffbb79839d510986ab939.tar.gz
bcm5719-llvm-637049515fa392383a8ffbb79839d510986ab939.zip
Have a few places that want to simplify phi nodes use SimplifyInstruction
rather than calling hasConstantValue. No intended functionality change. llvm-svn: 119352
Diffstat (limited to 'llvm/lib/Transforms/Utils/SSAUpdater.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/SSAUpdater.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/SSAUpdater.cpp b/llvm/lib/Transforms/Utils/SSAUpdater.cpp
index c855988307e..2b21fdf6678 100644
--- a/llvm/lib/Transforms/Utils/SSAUpdater.cpp
+++ b/llvm/lib/Transforms/Utils/SSAUpdater.cpp
@@ -14,6 +14,7 @@
#define DEBUG_TYPE "ssaupdater"
#include "llvm/Instructions.h"
#include "llvm/ADT/DenseMap.h"
+#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Support/AlignOf.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/CFG.h"
@@ -178,9 +179,9 @@ Value *SSAUpdater::GetValueInMiddleOfBlock(BasicBlock *BB) {
// See if the PHI node can be merged to a single value. This can happen in
// loop cases when we get a PHI of itself and one other value.
- if (Value *ConstVal = InsertedPHI->hasConstantValue()) {
+ if (Value *V = SimplifyInstruction(InsertedPHI)) {
InsertedPHI->eraseFromParent();
- return ConstVal;
+ return V;
}
// If the client wants to know about all new instructions, tell it.
OpenPOWER on IntegriCloud