//===----------------------------------------------------------------------===//
#include "ReduceBasicBlocks.h"
+#include "llvm/ADT/DenseSet.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
/// Replaces BB Terminator with one that only contains Chunk BBs
static void replaceBranchTerminator(BasicBlock &BB,
- const std::set<BasicBlock *> &BBsToKeep) {
+ const DenseSet<BasicBlock *> &BBsToKeep) {
auto *Term = BB.getTerminator();
std::vector<BasicBlock *> ChunkSucessors;
for (auto *Succ : successors(&BB))
/// replace with something)
static void
removeUninterestingBBsFromSwitch(SwitchInst &SwInst,
- const std::set<BasicBlock *> &BBsToKeep) {
+ const DenseSet<BasicBlock *> &BBsToKeep) {
if (!BBsToKeep.count(SwInst.getDefaultDest())) {
auto *FnRetTy = SwInst.getParent()->getParent()->getReturnType();
ReturnInst::Create(SwInst.getContext(),
// We create a vector first, then convert it to a set, so that we don't have
// to pay the cost of rebalancing the set frequently if the order we insert
// the elements doesn't match the order they should appear inside the set.
- std::set<BasicBlock *> BBsToKeep(InitBBsToKeep.begin(), InitBBsToKeep.end());
+ DenseSet<BasicBlock *> BBsToKeep(InitBBsToKeep.begin(), InitBBsToKeep.end());
std::vector<BasicBlock *> BBsToDelete;
for (auto &F : Program)