search for: getbasicblock

Displaying 20 results from an estimated 65 matches for "getbasicblock".

2017 Jun 28
2
About the concept of "materialization"
.../ dummy basic block for now, and replace it once we've materialized all // the initializers. BasicBlock *BB; if (F->empty()) { DelayedBBs.push_back(DelayedBasicBlock(BA)); BB = DelayedBBs.back().TempBB.get(); } else { BB = cast_or_null<BasicBlock>(mapValue(BA.getBasicBlock())); } return getVM()[&BA] = BlockAddress::get(F, BB ? BB : BA.getBasicBlock()); } Thanks, Pei On 6/28/17, 10:59 AM, "陳韋任" <chenwj.cs97g at g2.nctu.edu.tw> wrote: 2017-06-29 1:55 GMT+08:00 Pei Wang via llvm-dev <llvm-dev at lists.llvm.org>: > Bruce,...
2010 Oct 15
2
[LLVMdev] how to get MachineBasicBlock of a BasicBlock
Hello, we can get BasicBlock from MachineBasicBlock through MachineBasicBlock::getBasicBlock() function, but how can I get MachineBasicBlock of a BasicBlock? Thank you!
2015 Aug 01
3
[LLVMdev] SelectionDAG viewers, filter-view-dags question
...(void)BlockNumber; bool MatchFilterBB = false; (void)MatchFilterBB; #ifndef NDEBUG - MatchFilterBB = (!FilterDAGBasicBlockName.empty() && + MatchFilterBB = (FilterDAGBasicBlockName.empty() || FilterDAGBasicBlockName == FuncInfo->MBB->getBasicBlock()->getName().str()); #endif — Mehdi > On Aug 1, 2015, at 11:07 AM, Ryan Taylor <ryta1203 at gmail.com> wrote: > > Simply replacing the && with || did not fix the issue. This issue still exists after making those changes. There is maybe some other code that needs to...
2010 Oct 15
1
[LLVMdev] how to get MachineBasicBlock of a BasicBlock
...nnot work. I do not see much in the basic block which can identify > it. > > So you can search for it. > > typedef struct findBlock { > BasicBlock * block; > findBlock( BasicBlock * block ) : block(block) {} > bool operator( MachineBasicBlock * mbb ) { return > mbb->getBasicBlock() == block; } > } findBlock; > MachineBasicBlock = *std::find( machineFunction.begin(), > machineFunction.end(), > findBlock( basicBlock ) ); > > -Thanks > -Jeff Kunkel > > 2010/10/15 徐敏 <xm1988 at mail.ustc.edu.cn>: > > Hello, we can get BasicBlock from Mach...
2015 Jul 27
2
[LLVMdev] SelectionDAG viewers, filter-view-dags question
...ke the fix wasn't merged. I don't have the revision number for the fix to hand but in lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp, this: MatchFilterBB = (!FilterDAGBasicBlockName.empty() && FilterDAGBasicBlockName == FuncInfo->MBB->getBasicBlock()->getName().str()); Should be: MatchFilterBB = (FilterDAGBasicBlockName.empty() || FilterDAGBasicBlockName == FuncInfo->MBB->getBasicBlock()->getName().str()); The trunk has the correct code so the option should be ok for LLVM 3.7. From: Ry...
2009 Sep 10
1
[LLVMdev] Loading ProfileInfo in Backend. (Was: [PATCH] & Question: Preserving ProfileInfo for backend.)
...9;m still seeing execution counts of -1 when I print > them out in my MachineFunction pass. I access the profiling > information at each MachineBasicBlock with the following code, where > "bb" is a reference to the current MachineBasicBlock: > > PI->getExecutionCount(bb.getBasicBlock()) What does "llc -debug-pass=Structure" say? Is the ProfileLoaderPass really the last pass to touch the ProfileInfo before you are using it? Also, does bb.getBasicBlock() for sure always returns a valid block refrerence? You are getting the PI by getAnalysis<ProfileInfo>() I pre...
2009 Sep 09
2
[LLVMdev] [PATCH] & Question: Preserving ProfileInfo for backend.
...way. Unfortunately, I'm still seeing execution counts of -1 when I print them out in my MachineFunction pass. I access the profiling information at each MachineBasicBlock with the following code, where "bb" is a reference to the current MachineBasicBlock: PI->getExecutionCount(bb.getBasicBlock()) I believe I've integrated all the ProfileInfo* files from ToT with my LLVM-2.5 installation properly. The profiling code (and llvm-prof) seems to be working since llvm-prof is generating/printing the appropriate execution frequencies. Is there an obvious mistake that I could be making? S...
2010 Oct 15
0
[LLVMdev] how to get MachineBasicBlock of a BasicBlock
...Block( BasicBlock::{get the number} ) cannot work. I do not see much in the basic block which can identify it. So you can search for it. typedef struct findBlock { BasicBlock * block; findBlock( BasicBlock * block ) : block(block) {} bool operator( MachineBasicBlock * mbb ) { return mbb->getBasicBlock() == block; } } findBlock; MachineBasicBlock = *std::find( machineFunction.begin(), machineFunction.end(), findBlock( basicBlock ) ); -Thanks -Jeff Kunkel 2010/10/15 徐敏 <xm1988 at mail.ustc.edu.cn>: > Hello, we can get BasicBlock from MachineBasicBlock through MachineBasicBlock::getBas...
2015 Jul 27
1
[LLVMdev] SelectionDAG viewers, filter-view-dags question
...'t have the revision number for the fix to hand but in > lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp, this: > > MatchFilterBB = (!FilterDAGBasicBlockName.empty() && > > FilterDAGBasicBlockName == > > FuncInfo->MBB->getBasicBlock()->getName().str()); > > Should be: > > MatchFilterBB = (FilterDAGBasicBlockName.empty() || > > FilterDAGBasicBlockName == > > FuncInfo->MBB->getBasicBlock()->getName().str()); > > > > The trunk has the corr...
2015 Aug 11
2
Fwd: [LLVMdev] SelectionDAG viewers, filter-view-dags question
...(void)BlockNumber; bool MatchFilterBB = false; (void)MatchFilterBB; #ifndef NDEBUG - MatchFilterBB = (!FilterDAGBasicBlockName.empty() && + MatchFilterBB = (FilterDAGBasicBlockName.empty() || FilterDAGBasicBlockName == FuncInfo->MBB->getBasicBlock()->getName().str()); #endif — Mehdi On Aug 1, 2015, at 11:07 AM, Ryan Taylor <ryta1203 at gmail.com<mailto:ryta1203 at gmail.com>> wrote: Simply replacing the && with || did not fix the issue. This issue still exists after making those changes. There is maybe some othe...
2009 Sep 10
0
[LLVMdev] Loading ProfileInfo in Backend. (Was: [PATCH] & Question: Preserving ProfileInfo for backend.)
...ion Instructions Remove unreachable blocks from the CFG Optimize for code generation Insert stack protectors X86 DAG->DAG Instruction Selection X86 FP_REG_KILL inserter X86 Maximal Stack Alignment Calculator <MY PASS RUNS HERE> > Also, does bb.getBasicBlock() for sure always returns a valid block > refrerence? Yes. I am printing bb and *bb.getBasicBlock() in order to compare the contents of the IR in the BasicBlock and the target assembly in the MachineBasicBlock. > You are getting the PI by getAnalysis<ProfileInfo>() I presume? Is this...
2006 Jul 05
0
[LLVMdev] Critical edges
...dst_has_many_pred = true; break; } } return src_has_many_succ && dst_has_many_pred; } void CriticalEdgeRemoval_Fer::split_critical_edge (MachineBasicBlock & src, MachineBasicBlock & dst, MachineFunction & mf) { const BasicBlock * src_bb = src.getBasicBlock(); const BasicBlock * dst_bb = dst.getBasicBlock(); MachineBasicBlock * crit_mbb = new MachineBasicBlock(src_bb); src.addSuccessor(crit_mbb); crit_mbb->addSuccessor(& dst); src.removeSuccessor(& dst); ilist<MachineBasicBlock>::iterator mbb_it = mf.getLast...
2020 Mar 13
2
How to simply split MachineBasicBlock ?
...nchRelaxation::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->end(),mbb,mbb->begin(),mi); } Originally, mi is in BB. (mi would be a call instruction) (do not consider mi is a branch instruction) BB --> BB1 , BB2 Then, I split BB, mi is the fi...
2012 Sep 26
0
[LLVMdev] [PATCH / PROPOSAL] bitcode encoding that is ~15% smaller for large bitcode files...
...UseRelativeIDs = false; > + } Likewise. > > InstructionList.clear(); > unsigned ModuleValueListSize = ValueList.size(); ... > @@ -2260,8 +2275,10 @@ bool BitcodeReader::ParseFunctionBody(Function *F) { > } > else { > BasicBlock *FalseDest = getBasicBlock(Record[1]); > - Value *Cond = getFnValueByID(Record[2], Type::getInt1Ty(Context)); > - if (FalseDest == 0 || Cond == 0) > + Value *Cond; > + if (getValueConst(Record, 2, > + NextValueNo, Type::getInt1Ty(Context), Cond) || > +...
2009 Sep 10
2
[LLVMdev] Loading ProfileInfo in Backend. (Was: [PATCH] & Question: Preserving ProfileInfo for backend.)
...ocks from the CFG > Optimize for code generation > Insert stack protectors > X86 DAG->DAG Instruction Selection > X86 FP_REG_KILL inserter > X86 Maximal Stack Alignment Calculator > <MY PASS RUNS HERE> > > >> Also, does bb.getBasicBlock() for sure always returns a valid block >> refrerence? > > Yes. I am printing bb and *bb.getBasicBlock() in order to compare the > contents of the IR in the BasicBlock and the target assembly in the > MachineBasicBlock. > >> You are getting the PI by getAnalysis<Prof...
2006 Jul 04
2
[LLVMdev] Critical edges
On Tue, 4 Jul 2006, Fernando Magno Quintao Pereira wrote: > However, it does not remove all the critical edges. I am getting a very > weird dataflow graph (even without the Break Critical edges pass). The > dataflow generated by MachineFunction::dump() for the program below is > given here: > http://compilers.cs.ucla.edu/fernando/projects/soc/images/loop_no_crit2.pdf ... > The
2017 Jul 25
2
[Debug] Elide the unconditional branch instructions
...ebug information, we don't eliminate the unconditional branch instruction, otherwise we eliminate it. /// (fall-through) successor, and update the CFG. void FastISel::fastEmitBranch(MachineBasicBlock *MSucc, const DebugLoc &DbgLoc) { - if (FuncInfo.MBB->getBasicBlock()->size() > 1 && - FuncInfo.MBB->isLayoutSuccessor(MSucc)) { - // For more accurate line information if this is the only instruction - // in the block then emit it, otherwise we have the unconditional + if (FuncInfo.MBB->isLayoutSuccessor(MSucc) && !DbgLoc) {...
2011 Jul 01
2
[LLVMdev] LLVM Instr from MachineInstr
Hi, Is there any way to get a pointer to the LLVM Instr from which a particular MachineInstr is generated ? Although I understand it goes through many optimization after a LLVM instruction is converted to SDAG node, so maintaining such a mapping will be hard. Still is the mapping stored some where which can give some sane results at least in case of -O0? Thanks and regards, Ankur
2011 Jul 01
0
[LLVMdev] LLVM Instr from MachineInstr
Hi Ankur, For a MachineBasicBlock you can call getBasicBlock() to find the IR level BasicBlock from which it was generated (if there isn't a one, it will return NULL). I don't know of a way to get a finer granularity than that, though. -Jim On Jul 1, 2011, at 1:06 AM, ankur deshwal wrote: > Hi, > > Is there any way to get a pointer to th...
2006 Oct 03
0
[LLVMdev] Out of range address
On Tue, 3 Oct 2006, Fernando Magno Quintao Pereira wrote: > I am having some problems when compiling huge programs (like gcc). > I have a machine pass to destroy critical edges, and I have to add > new basic blocks, but sometimes the program is too big, and the new > basic block gets out of addressing range. What is the proper way to > address this problem? I am producing code