diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-08-22 15:37:57 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-08-22 15:37:57 +0000 |
commit | 05d96f98cbd96dab7f4ea1ea4ebe4285597e7e88 (patch) | |
tree | b32c92e060826c319744e00e4f74a20de33ad62f /lib/CodeGen/BranchFolding.cpp | |
parent | fdeb9fe5e08146d9cb953000cb893eda80329a08 (diff) | |
download | llvm-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/CodeGen/BranchFolding.cpp')
-rw-r--r-- | lib/CodeGen/BranchFolding.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp index fb65bb7f3f..7df0e15292 100644 --- a/lib/CodeGen/BranchFolding.cpp +++ b/lib/CodeGen/BranchFolding.cpp @@ -1554,8 +1554,7 @@ MachineBasicBlock::iterator findHoistingInsertPosAndDeps(MachineBasicBlock *MBB, for (MCRegAliasIterator AI(Reg, TRI, true); AI.isValid(); ++AI) Uses.insert(*AI); } else { - if (Uses.count(Reg)) { - Uses.erase(Reg); + if (Uses.erase(Reg)) { for (MCSubRegIterator SubRegs(Reg, TRI); SubRegs.isValid(); ++SubRegs) Uses.erase(*SubRegs); // Use sub-registers to be conservative } |