[llvm-branch-commits] [llvm-branch] r181619 - Merging r181397:
Bill Wendling
isanbard at gmail.com
Fri May 10 11:23:11 PDT 2013
Author: void
Date: Fri May 10 13:23:11 2013
New Revision: 181619
URL: http://llvm.org/viewvc/llvm-project?rev=181619&view=rev
Log:
Merging r181397:
------------------------------------------------------------------------
r181397 | nicholas | 2013-05-08 02:00:10 -0700 (Wed, 08 May 2013) | 3 lines
Fix a bug in codegenprep where it was losing track of values OptimizeMemoryInst
by switching to a ValueMap. Patch by Andrea DiBiagio!
------------------------------------------------------------------------
Added:
llvm/branches/release_33/test/CodeGen/X86/codegen-prepare.ll
- copied unchanged from r181397, llvm/trunk/test/CodeGen/X86/codegen-prepare.ll
Modified:
llvm/branches/release_33/ (props changed)
llvm/branches/release_33/lib/Transforms/Scalar/CodeGenPrepare.cpp
Propchange: llvm/branches/release_33/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri May 10 13:23:11 2013
@@ -1,3 +1,3 @@
/llvm/branches/Apple/Pertwee:110850,110961
/llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,181286,181296,181313,181423
+/llvm/trunk:155241,181286,181296,181313,181397,181423
Modified: llvm/branches/release_33/lib/Transforms/Scalar/CodeGenPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_33/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=181619&r1=181618&r2=181619&view=diff
==============================================================================
--- llvm/branches/release_33/lib/Transforms/Scalar/CodeGenPrepare.cpp (original)
+++ llvm/branches/release_33/lib/Transforms/Scalar/CodeGenPrepare.cpp Fri May 10 13:23:11 2013
@@ -18,6 +18,7 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/Statistic.h"
+#include "llvm/ADT/ValueMap.h"
#include "llvm/Analysis/DominatorInternals.h"
#include "llvm/Analysis/Dominators.h"
#include "llvm/Analysis/InstructionSimplify.h"
@@ -88,7 +89,7 @@ namespace {
/// Keeps track of non-local addresses that have been sunk into a block.
/// This allows us to avoid inserting duplicate code for blocks with
/// multiple load/stores of the same address.
- DenseMap<Value*, Value*> SunkAddrs;
+ ValueMap<Value*, Value*> SunkAddrs;
/// ModifiedDT - If CFG is modified in anyway, dominator tree may need to
/// be updated.
@@ -1653,10 +1654,6 @@ bool CodeGenPrepare::OptimizeMemoryInst(
// start of the block.
CurInstIterator = BB->begin();
SunkAddrs.clear();
- } else {
- // This address is now available for reassignment, so erase the table
- // entry; we don't want to match some completely different instruction.
- SunkAddrs[Addr] = 0;
}
}
++NumMemoryInsts;
More information about the llvm-branch-commits
mailing list