diff options
author | Duncan Sands <baldrick@free.fr> | 2012-02-27 09:54:35 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2012-02-27 09:54:35 +0000 |
commit | 1be25a78f71e3f7a36358b2ed7e387a65015c61c (patch) | |
tree | 4c9c88e5fecc1fea0315ac047ce81152702a8804 /llvm/lib/Transforms/Scalar/GVN.cpp | |
parent | a1a3a2ffc3f52db82f475b91171720bd0333e307 (diff) | |
download | bcm5719-llvm-1be25a78f71e3f7a36358b2ed7e387a65015c61c.tar.gz bcm5719-llvm-1be25a78f71e3f7a36358b2ed7e387a65015c61c.zip |
The value numbering function is recursive, so it is possible for multiple new
value numbers to be assigned when calculating any particular value number.
Enhance the logic that detects new value numbers to take this into account,
for a tiny compile time speedup. Fix a comment typo while there.
llvm-svn: 151522
Diffstat (limited to 'llvm/lib/Transforms/Scalar/GVN.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/GVN.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp index 68281e66207..06a8be0ba21 100644 --- a/llvm/lib/Transforms/Scalar/GVN.cpp +++ b/llvm/lib/Transforms/Scalar/GVN.cpp @@ -2144,7 +2144,7 @@ bool GVN::processInstruction(Instruction *I) { } // Instructions with void type don't return a value, so there's - // no point in trying to find redudancies in them. + // no point in trying to find redundancies in them. if (I->getType()->isVoidTy()) return false; uint32_t NextNum = VN.getNextUnusedValueNumber(); @@ -2160,7 +2160,7 @@ bool GVN::processInstruction(Instruction *I) { // If the number we were assigned was a brand new VN, then we don't // need to do a lookup to see if the number already exists // somewhere in the domtree: it can't! - if (Num == NextNum) { + if (Num >= NextNum) { addToLeaderTable(Num, I, I->getParent()); return false; } |