diff options
author | Duncan Sands <baldrick@free.fr> | 2010-11-16 17:41:24 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2010-11-16 17:41:24 +0000 |
commit | cdbd99262286e96729007ac535cd430ecb3d38ac (patch) | |
tree | 29ee4b438d3edd840c88bd268c3bfe4815f0b29a /lib/Transforms/Utils/SSAUpdater.cpp | |
parent | ab7fa0885e8351c0d510938caeac83d3000031d1 (diff) |
Have a few places that want to simplify phi nodes use SimplifyInstruction
rather than calling hasConstantValue. No intended functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119352 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/SSAUpdater.cpp')
-rw-r--r-- | lib/Transforms/Utils/SSAUpdater.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/SSAUpdater.cpp b/lib/Transforms/Utils/SSAUpdater.cpp index c855988307..2b21fdf667 100644 --- a/lib/Transforms/Utils/SSAUpdater.cpp +++ b/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. |