Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] problem with llvm reverse iterator"
2007 Apr 12
8
[LLVMdev] Regalloc Refactoring
Chris Lattner wrote:
> On Thu, 12 Apr 2007, David Greene wrote:
>> As I work toward improving LLVM register allocation, I've
>> come across the need to do some refactoring.
>
> cool. :) One request: Evan is currently out on vacation until Monday.
> This is an area that he is very interested in and will want to chime in
> on. Please don't start anything
2015 Apr 01
2
[LLVMdev] Why the fault?
for (BasicBlock::reverse_iterator I = BB.rbegin(), E = BB.rend(); I != E; ) {
Instruction& inst = *I;
++I; <-- iterator should be advanced to the previous instruction
// Happens to be an Instruction::SExt.
// Works fine if I iterate forwards
if (isInstructionTriviallyDead(&inst, TLI))
inst.eraseFromParent();
}
Sorry for the inexperienced question, but
2009 Nov 14
5
[LLVMdev] next
In many places there is code that looks like:
MBBI = next(MBBI);
In C++0X there is a std::next that is likely to be in scope when these
calls are made. And due to ADL the above call becomes ambiguous:
llvm::next or std::next?
I recommend:
MBBI = llvm::next(MBBI);
-Howard
2007 Apr 14
0
[LLVMdev] Regalloc Refactoring
On Thu, 12 Apr 2007, David Greene wrote:
>> Beyond that, one of the issues is the "r2rmap" and "rep" function. As
>> you've noticed, the coallescer basically uses these to avoid rewriting the
>> code after it does coallescing. For example, if r1024 is coallesced with
>> r1026, it leaves all uses of both registers in the code, instead of
>>
2007 Apr 16
0
[LLVMdev] Regalloc Refactoring
On Apr 12, 2007, at 2:37 PM, David Greene wrote:
> Chris Lattner wrote:
>> On Thu, 12 Apr 2007, David Greene wrote:
>>> As I work toward improving LLVM register allocation, I've
>>> come across the need to do some refactoring.
Yay!
>> Beyond that, one of the issues is the "r2rmap" and "rep"
>> function. As
>> you've
2007 Apr 12
0
[LLVMdev] Regalloc Refactoring
On Thu, 12 Apr 2007, David Greene wrote:
> As I work toward improving LLVM register allocation, I've
> come across the need to do some refactoring.
cool. :) One request: Evan is currently out on vacation until Monday.
This is an area that he is very interested in and will want to chime in
on. Please don't start anything drastic until he gets back :).
> Specifically, I would
2007 Jun 22
4
[LLVMdev] df_ext_iterator in LiveIntervalAnalysis
I would like to make a suggestion. In the LiveIntervalAnalysis class,
instead of numbering the instructions in the order in which basic blocks
are stored in the machine function, use the df_ext_iterator. It will order
the instruction according to the dominance tree (or it seems to be doing
so). There are many advantages in doing this. One of them is that, once
you traverse the dominance tree
2007 Jun 22
0
[LLVMdev] df_ext_iterator in LiveIntervalAnalysis
On Thu, 21 Jun 2007, Fernando Magno Quintao Pereira wrote:
> I would like to make a suggestion. In the LiveIntervalAnalysis class,
> instead of numbering the instructions in the order in which basic blocks
> are stored in the machine function, use the df_ext_iterator. It will order
> the instruction according to the dominance tree (or it seems to be doing
> so). There are many
2007 Jun 22
0
[LLVMdev] df_ext_iterator in LiveIntervalAnalysis
Nice idea. Please also try using SmallPtrSet (with a sufficiently
large size) instead of std::set for traversal after everything is
working. Using std::set can really hurt compile time in case of large
basic block numbers.
Is there a way to dynamically adjust "SmallSize" based on number of
basic blocks in the function?
Evan
On Jun 21, 2007, at 10:20 PM, Fernando Magno Quintao
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
2009 Nov 16
0
[LLVMdev] next
I am pretty sure the .cpp files always explicitly use "llvm" namespace. Look for:
using namespace llvm;
Is that sufficient?
Evan
On Nov 14, 2009, at 3:16 PM, Howard Hinnant wrote:
> In many places there is code that looks like:
>
> MBBI = next(MBBI);
>
> In C++0X there is a std::next that is likely to be in scope when these
> calls are made. And due to ADL
2015 Feb 11
2
[LLVMdev] deleting or replacing a MachineInst
I made the change to the BuildMI() call. Again, I don't think that matters.
#define BUILD_INS(opcode, new_reg, i) \
BuildMI(*MBB, OldMI, MBBI->getDebugLoc(), TII->get(X86::opcode)) \
.addReg(X86::new_reg, kill).addImm(i)
I didn't completely understand your other proposed change:
for (MachineBasicBlock::iterator MBBI = MBB->begin();
2010 Aug 29
1
[LLVMdev] [Query] Programming Register Allocation
Thanks for the information.
I still don't know how do I partition registers into different classes from
the virtual registers? For instance, I have the function who which iterates
over the instructions, but I don't know how to write the function which
returns the different register class.
void RAOptimal::Gather(MachineFunction &Fn) {
// Gather just iterates over the blocks,
2010 Nov 05
0
[LLVMdev] Basic block liveouts
Because I feel bad for giving a non-answer:
An easy way to find if a virtual register is alive after the basic block is
to
While iterating over the virtual registers
- Check to see if the virtual register's "next" value exists outside of the
basic block.
for instance:
std::vector<unsigned> findLiveOut( MachineBasicBlock * mbb ) {
std::vector<unsigned> liveout;
for(
2009 Nov 16
4
[LLVMdev] next
On Nov 16, 2009, at 1:43 PM, Dale Johannesen wrote:
>
> On Nov 14, 2009, at 3:16 PMPST, Howard Hinnant wrote:
>
>> In many places there is code that looks like:
>>
>> MBBI = next(MBBI);
>>
>> In C++0X there is a std::next that is likely to be in scope when these
>> calls are made. And due to ADL the above call becomes ambiguous:
>>
2009 Nov 16
0
[LLVMdev] next
On Nov 14, 2009, at 3:16 PMPST, Howard Hinnant wrote:
> In many places there is code that looks like:
>
> MBBI = next(MBBI);
>
> In C++0X there is a std::next that is likely to be in scope when these
> calls are made. And due to ADL the above call becomes ambiguous:
> llvm::next or std::next?
>
> I recommend:
>
> MBBI = llvm::next(MBBI);
>
> -Howard
2009 Nov 16
0
[LLVMdev] next
On Nov 16, 2009, at 10:49 AMPST, Howard Hinnant wrote:
> On Nov 16, 2009, at 1:43 PM, Dale Johannesen wrote:
>
>>
>> On Nov 14, 2009, at 3:16 PMPST, Howard Hinnant wrote:
>>
>>> In many places there is code that looks like:
>>>
>>> MBBI = next(MBBI);
>>>
>>> In C++0X there is a std::next that is likely to be in scope when
2014 Jul 26
2
[LLVMdev] Finding previous emitted instruction
Hi All,
For various obscure reasons I'd like to detect the condition when X86 CALL
instruction immediately precedes a function epilogue in the final emitted
code, and insert a NOP between them if that happens.
My initial attempt at it looked like this:
MachineBasicBlock& MBB;
MachineBasicBlock::iterator MBBI; <-- points to where the epilogue would
be inserted
if (MBBI != MBB.begin()
2015 Feb 11
2
[LLVMdev] deleting or replacing a MachineInst
There are 11 BuildMI() functions in MachineInstrBuilder.h including four
using the iterator and one using an instruction. But I just don't think
that's it. The creation of the new instruction works fine (works fine with
OldMI as well) and the new instruction is present in the assembly output.
The problem is removing the old instruction correctly.
> The loop header needs to be
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 =