search for: mbb

Displaying 20 results from an estimated 526 matches for "mbb".

Did you mean: mb
2008 Apr 16
3
[LLVMdev] Possible bug in LiveIntervalAnalysis?
Hi, In the LiveIntervalAnalysis::runOnMachineFunction, there is a code to compute the MBB2IdxMap, by remembering for each MBB its start and end instruction numbers: unsigned MIIndex = 0; for (MachineFunction::iterator MBB = mf_->begin(), E = mf_->end(); MBB != E; ++MBB) { unsigned StartIdx = MIIndex; for (MachineBasicBlock::iterator I = MBB->begin(), E = MB...
2007 Jun 22
4
[LLVMdev] df_ext_iterator in LiveIntervalAnalysis
...iIndex = 0; MachineBasicBlock *entry = mf_->begin(); std::set<MachineBasicBlock*> visited; for (df_ext_iterator<MachineBasicBlock*> dfi = df_ext_begin(entry, visited), endi = df_ext_end(entry, visited); dfi != endi; ++dfi) { MachineBasicBlock *mbb = *dfi; for (MachineBasicBlock::iterator mi = mbb->begin(), miEnd = mbb->end(); mi != miEnd; ++mi) { bool inserted = mi2iMap_.insert(std::make_pair(mi, miIndex)).second; assert(inserted && "mul...
2014 Dec 08
2
[LLVMdev] Virtual register problem in X86 backend
...ic and I use a custom inserter. The goal of the intrinsic is to set the content of the stack to zero at the end of each function. Here is my code: MachineBasicBlock * X86TargetLowering::EmitBURNSTACKWithCustomInserter( MachineInstr *MI, MachineBasicBlock *MBB) const { DebugLoc db = MI->getDebugLoc(); const TargetInstrInfo *TII = getTargetMachine().getInstrInfo(); const BasicBlock *LLVM_BB = MBB->getBasicBlock(); MachineFunction *F = MBB->getParent(); // Create all the basicblocks MachineBasicBlock *MBB_cond = F->Crea...
2010 Oct 20
1
[LLVMdev] MachineBasicBlock insertion
.../ the new basic block is inserted right before I void X86CFIOptPass::insertBasicBlockBefore(MachineFunction &MF, MachineBasicBlock *Pred, MachineFunction::iterator I){ const BasicBlock* LLVM_BB = Pred->getBasicBlock(); MachineBasicBlock * MBB = MF.CreateMachineBasicBlock(LLVM_BB); // create a MBB MBB->setNumber(19880616); // set the number of MBB to be 19880616 which is used as an ID Pred->addSuccessor(MBB); const TargetInstrInfo *TII = MF.getTarget().getInstrInfo(); DebugLoc dl; // CALLpcrel32 abort BuildMI(M...
2014 Nov 06
2
[LLVMdev] Should the MachineVerifier accept a MBB with a single (landing pad) successor?
Hi all, I've been investigating a machine verifier failure on the attached testcase, and I'm tempted to say the verifier is wrong and should accept it. Skip the description for the proposed change. On AArch64, the verifier complains with: *** Bad machine code: MBB exits via unconditional branch but doesn't have exactly one CFG successor! *** - function: t4 - basic block: BB#5 invoke.cont41 The freshly selected relevant blocks are: BB#7: derived from LLVM BB %invoke.cont41 EH_LABEL <MCSym=Ltmp4> B <BB#8&gt...
2014 Oct 28
2
[LLVMdev] Problem in X86 backend (again)
...2,... I really can't figure what I'm doing wrong... Any idea? Here is the code of my custom inserter... The goal of this code is to erase the stack in the epilogue of a function: MachineBasicBlock * X86TargetLowering::EmitBURNSTACKWithCustomInserter( MachineInstr *MI, MachineBasicBlock *MBB) const { MBB->getParent()->dump(); DebugLoc db = MI->getDebugLoc(); const TargetInstrInfo *TII = getTargetMachine().getInstrInfo(); const BasicBlock *LLVM_BB = MBB->getBasicBlock(); MachineFunction *F = MBB->getParent(); // Create all the basicblocks MachineBasicBlock *MBB_cond = F-&...
2008 Apr 16
0
[LLVMdev] Possible bug in LiveIntervalAnalysis?
Hi I'm seeing something probably related to this. I'm getting an assert from the lower_bound in LiveIntervals::findLiveinMBBs (from a checking std:: VS2005 implementation). Idx2MBBMap has two elements in it, both of which have a .first of 0. (I believe because of an empty MBB in the function below, so StartIndex doesn't advance). scott On Wed, Apr 16, 2008 at 2:52 AM, Roman Levenstein <romixlev at yahoo.com>...
2013 Jan 18
0
[LLVMdev] llvm backend porting question ,
...ode . below is my code , the whole porting with this error can by found at github : https://github.com/huangjielg/llvm-picoblaze/tree/a667350354ca1f8d23da5e76b598b8327ef239bc/lib/Target/Picoblaze /******************************/ void PicoblazeInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned SrcReg, bool isKill, int FrameIdx, const TargetRegisterClass *RC, const Targe...
2008 Apr 18
1
[LLVMdev] Possible bug in LiveIntervalAnalysis?
...on't forget? I'm a little occupied right now. But I'll take care of this soon. Evan On Apr 16, 2008, at 10:52 AM, Scott Graham wrote: > Hi > > I'm seeing something probably related to this. I'm getting an assert > from the lower_bound in LiveIntervals::findLiveinMBBs (from a checking > std:: VS2005 implementation). Idx2MBBMap has two elements in it, both > of which have a .first of 0. (I believe because of an empty MBB in the > function below, so StartIndex doesn't advance). > > scott > > On Wed, Apr 16, 2008 at 2:52 AM, Roman Levenste...
2007 Jun 22
0
[LLVMdev] df_ext_iterator in LiveIntervalAnalysis
...sicBlock *entry = mf_->begin(); > std::set<MachineBasicBlock*> visited; > for (df_ext_iterator<MachineBasicBlock*> dfi = df_ext_begin(entry, > visited), > endi = df_ext_end(entry, visited); dfi != endi; > ++dfi) { > MachineBasicBlock *mbb = *dfi; > for (MachineBasicBlock::iterator mi = mbb->begin(), miEnd = > mbb->end(); > mi != miEnd; > ++mi) { > bool inserted = mi2iMap_.insert(std::make_pair(mi, > miIndex)).second; > assert(i...
2007 Jun 22
0
[LLVMdev] df_ext_iterator in LiveIntervalAnalysis
...lock *entry = mf_->begin(); > std::set<MachineBasicBlock*> visited; > for (df_ext_iterator<MachineBasicBlock*> dfi = df_ext_begin(entry, > visited), > endi = df_ext_end(entry, visited); dfi != endi; > ++dfi) { > MachineBasicBlock *mbb = *dfi; > for (MachineBasicBlock::iterator mi = mbb->begin(), miEnd = > mbb->end(); > mi != > miEnd; > ++mi) { > bool inserted = mi2iMap_.insert(std::make_pair(mi, > miIndex)).second; >...
2020 Mar 13
3
Why MachineBasicBlcok doesn't have transferPredecessors() ?
for example I want to insert a new machine bb “before” a specific machine bb. or split a mbb and keep the later one as the original one. (to keep the label/Blackadder's correct t) (or keep other property of mbb) so I need to transfer the original mbb's predecessor to the new mbb. Nicolai Hähnle <nhaehnle at gmail.com> 於 2020年3月13日 週五 23:57 寫道: > On Fri, Mar 13, 2020...
2010 Oct 20
1
[LLVMdev] MachineBasicBlock insertion and use/def list update
...insert MachineBasicBlock into a MachineFunction? Any advice will be appreciated. Thanks a lot in advance. ~Bin ---------------------------------------------------------------------------------------------------------------------------- Thanks a lot Jeff. I changed the setNumber function call to MBB->setNumber(mf->addToMBBNumbering(MBB)); But it still enters the infinite loop. It is strange that if I insert all these instructions into an existing MachineBasicBlock, the error disappears. It is due to the way I create or insert MachineBasicBlocks in a wrong way. When each operand is ad...
2009 Feb 19
0
[LLVMdev] Bug in BranchFolding.cpp:OptimizeBlock
I've ran across an issue in BranchFolding.cpp where it is incorrectly folding a branch to the wrong fallthrough location. This is in LLVM 2.4 and seems to be in 2.5 also. The code in question is: void BranchFolder::OptimizeBlock(MachineBasicBlock *MBB) { MachineFunction::iterator FallThrough = MBB; ++FallThrough; // If this block is empty, make everyone use its fall-through, not the block // explicitly. Landing pads should not do this since the landing-pad table // points to this block. if (MBB->empty() && !MBB-...
2020 Mar 13
2
How to simply split MachineBasicBlock ?
...ction. But I don't insert or delete any machine instruction. I just "simply" , "purely" split the MachineBasicBlcok. (So, I stole the idea from ARM64BranchRelaxation::splitBlockBeforeInstr.) This is my code : // I would pass call instruction to this function void split_mbb(MachineInstr* mi){ MachineBasicBlock* mbb=mi->getParent(); MachineFunction* mf=mbb->getParent(); MachineBasicBlock* new_mbb=mf->CreateMachineBasicBlock(mbb->getBasicBlock()); MachineFunction::iterator mbb_it(mbb); mf->insert(mbb_it,new_mbb); new_mbb->splice(new_mbb-&g...
2017 Aug 22
5
[RFC] mir-canon: A new tool for canonicalizing MIR for cleaner diffing.
Patch for review. On Mon, Aug 21, 2017 at 11:45 PM Puyan Lotfi <puyan.lotfi.llvm at gmail.com> wrote: > Ping. > > Still working on preparing code for review. Will have a patch for review > ready in the coming days. > > PL > > On Tue, Aug 15, 2017 at 12:06 PM Puyan Lotfi <puyan.lotfi.llvm at gmail.com> > wrote: > >> Hi, >> >> >>
2014 Dec 10
2
[LLVMdev] Virtual register problem in X86 backend
...the content of the stack to zero at the end of >> each function. >> >> Here is my code: >> >> MachineBasicBlock * >> X86TargetLowering::EmitBURNSTACKWithCustomInserter( >> MachineInstr *MI, >> MachineBasicBlock *MBB) const { >> DebugLoc db = MI->getDebugLoc(); >> const TargetInstrInfo *TII = getTargetMachine().getInstrInfo(); >> const BasicBlock *LLVM_BB = MBB->getBasicBlock(); >> MachineFunction *F = MBB->getParent(); >> >> // Create all the basicblo...
2015 Feb 11
2
[LLVMdev] deleting or replacing a MachineInst
This seems a very natural approach but I probably am having a trouble with the iterator invalidation. However, looking at other peephole optimizers passes, I couldn't see how to do this: #define BUILD_INS(opcode, new_reg, i) \ BuildMI(*MBB, MBBI, MBBI->getDebugLoc(), TII->get(X86::opcode)) \ .addReg(X86::new_reg, kill).addImm(i) for (MachineFunction::iterator MFI = MF.begin(), MFE = MF.end(); MFI != MFE; ++MFI) { MachineBasicBlock* MBB = MFI; for (MachineBasicBlock::iterator MBBI = MBB->begin();...
2013 Jan 23
2
[LLVMdev] BlockFrequencyImpl asserts on multiple edges between same MBBs with different weights in LLVM 3.2
...else break; case 103: // do some more break; case 104: // now something different break; default: // handle other cases } } The compiler creates a jumptable for this and inserts an entry for 'case 101' that points to the default block. The machine-basic-block (MBB) of the switch therefore contains two edges to the default MBB, one edge for the jumptable, and another one for the jump handling the case when the index is not in the jumptable. For some reason, our backend assigns those edges different weights (let's say 24 for the default edge and 16 for...
2014 Jul 26
3
[LLVMdev] Machine basic blocks
Hi, I have a couple of questions about MachineBasicBlocks: - If I have a pointer to an MBB, is there an easy way to find which block that precedes it in the MachineFunction blocks list? (without iterating through all of the MF's basic blocks) - Does LLVM make any effort to ensure that MBB's predecessors and successors lists are semantically correct? For example, what happens...