summaryrefslogtreecommitdiff
path: root/lib/Target/ARM/ARMConstantIslandPass.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-08-22 15:37:57 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-08-22 15:37:57 +0000
commit05d96f98cbd96dab7f4ea1ea4ebe4285597e7e88 (patch)
treeb32c92e060826c319744e00e4f74a20de33ad62f /lib/Target/ARM/ARMConstantIslandPass.cpp
parentfdeb9fe5e08146d9cb953000cb893eda80329a08 (diff)
downloadllvm-05d96f98cbd96dab7f4ea1ea4ebe4285597e7e88.tar.gz
llvm-05d96f98cbd96dab7f4ea1ea4ebe4285597e7e88.tar.bz2
llvm-05d96f98cbd96dab7f4ea1ea4ebe4285597e7e88.tar.xz
Reduce duplicated hash map lookups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162362 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMConstantIslandPass.cpp')
-rw-r--r--lib/Target/ARM/ARMConstantIslandPass.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Target/ARM/ARMConstantIslandPass.cpp b/lib/Target/ARM/ARMConstantIslandPass.cpp
index a953985024..dd05f0cf40 100644
--- a/lib/Target/ARM/ARMConstantIslandPass.cpp
+++ b/lib/Target/ARM/ARMConstantIslandPass.cpp
@@ -1388,10 +1388,9 @@ bool ARMConstantIslands::handleConstantPoolUser(unsigned CPUserIndex) {
// If the original WaterList entry was "new water" on this iteration,
// propagate that to the new island. This is just keeping NewWaterList
// updated to match the WaterList, which will be updated below.
- if (NewWaterList.count(WaterBB)) {
- NewWaterList.erase(WaterBB);
+ if (NewWaterList.erase(WaterBB))
NewWaterList.insert(NewIsland);
- }
+
// The new CPE goes before the following block (NewMBB).
NewMBB = llvm::next(MachineFunction::iterator(WaterBB));