diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-07-09 14:48:08 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-07-09 14:48:08 +0000 |
commit | 1d3ae029c4f2a643df9ea9d0ed7c874a086d0ef2 (patch) | |
tree | b5c6bee6589636ff4072535a254de1c15331d04e /lib/Transforms | |
parent | 7c71b81a4fccd236e191dbbd6926b35fb4ac9b1e (diff) |
cache result of operator* (found by inspection)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107971 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/GVN.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index 8b656dc9d4..88b67768fa 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -2214,8 +2214,10 @@ bool GVN::performPRE(Function &F) { CurInst->getName() + ".pre-phi", CurrentBlock->begin()); for (pred_iterator PI = pred_begin(CurrentBlock), - PE = pred_end(CurrentBlock); PI != PE; ++PI) - Phi->addIncoming(predMap[*PI], *PI); + PE = pred_end(CurrentBlock); PI != PE; ++PI) { + BasicBlock *P = *PI; + Phi->addIncoming(predMap[P], P); + } VN.add(Phi, ValNo); localAvail[CurrentBlock]->table[ValNo] = Phi; |