[LLVMdev] Asserts in bundleWithPred() and bundleWithSucc()

Sergei Larin slarin at codeaurora.org
Fri Feb 1 15:43:08 PST 2013


Jakob,

  I have a question about the following (four) asserts recently added in
bundleWithPred() and bundleWithSucc() (see below). What is the real danger
of reasserting a connection even if it already exist? My problem with them
happens when I try to call finalizeBundle() on an existing bundle to which I
have added a new instruction. The goal - a new bundle header with liveness
abbreviation, but because of these asserts I now have to unbundle all, and
re-bundle them right back again for no obvious benefit...
  In other words, may I suggest removing them rather than adding new
methods?... or do you have a better suggestion?

Thanks.

Sergei

void MachineInstr::bundleWithPred() {
  assert(!isBundledWithPred() && "MI is already bundled with its
predecessor"); <<<<<<<<<<<<
  setFlag(BundledPred);
  MachineBasicBlock::instr_iterator Pred = this;
  --Pred;
  assert(!Pred->isBundledWithSucc() && "Inconsistent bundle flags");
<<<<<<<<<<<<<
  Pred->setFlag(BundledSucc);
}

void MachineInstr::bundleWithSucc() {
  assert(!isBundledWithSucc() && "MI is already bundled with its
successor"); <<<<<<<<<<<<<
  setFlag(BundledSucc);
  MachineBasicBlock::instr_iterator Succ = this;
  ++Succ;
  assert(!Succ->isBundledWithPred() && "Inconsistent bundle flags");
<<<<<<<<<<<<<<
  Succ->setFlag(BundledPred);
}

---
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by
The Linux Foundation





More information about the llvm-dev mailing list