Displaying 20 results from an estimated 21 matches for "getiterator".
2018 Apr 09
0
InstIterator
Within a basic block this is just normal iterator usage/manipulation:
for (instr : llvm::make_range(FromInstruction.getIterator(), ToInstruction.getIterator())) { ... }
Use std::next() on ToInstruction.getIterator() if you want it included.
- Matthias
> On Apr 9, 2018, at 10:04 AM, Alexandre Isoard via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
> Hello,
>
> Is there an iterator to iterate over...
2018 Apr 09
2
InstIterator
Hello,
Is there an iterator to iterate over a "range" of instructions in a
Function?
"range" meaning from an instruction::iterator up to an other
instruction::iterator which either:
- point to instructions in the same basic block (the first one first,
second one second)
- point to instructions in different basic block (the BB of the first
dominate the BB of the second, and
2015 Oct 21
3
ilist/iplist are broken (maybe I'll fix them?)
...but I still like having
>> them.
>
> IMO, if a developer has an ilist iterator and wants a pointer, they
> should explicitly use `&*I` to make the assumption that "`I` isn't the
> end iterator" explicit in the code. Similarly, in the other direction,
> `N->getIterator()` makes it clear that `N` is definitely not `nullptr`
> and is therefore safe to compare to an iterator.
+1. The convenience of the implicit conversion isn't worthwhile here.
While I'm not a huge fan of writing `&*I`, it's at least very obvious
that you need to check that I'...
2020 Jun 17
2
InstCombine doesn't delete instructions with token
.../llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -3012,7 +3012,7 @@ static bool prepareICWorklistFromFunction(Function
&F, const DataLayout &DL,
while (EndInst != BB->begin()) {
// Delete the next to last instruction.
Instruction *Inst = &*--EndInst->getIterator();
- if (!Inst->use_empty())
+ if (!Inst->use_empty() && !Inst->getType()->isTokenTy())
Inst->replaceAllUsesWith(UndefValue::get(Inst->getType()));
- if (Inst->isEHPad()) {
+ if (Inst->isEHPad() || Inst->getType()->isTokenTy()) {...
2020 Jun 17
2
InstCombine doesn't delete instructions with token
...Combine/InstructionCombining.cpp
> @@ -3012,7 +3012,7 @@ static bool prepareICWorklistFromFunction(Function
> &F, const DataLayout &DL,
> while (EndInst != BB->begin()) {
> // Delete the next to last instruction.
> Instruction *Inst = &*--EndInst->getIterator();
> - if (!Inst->use_empty())
> + if (!Inst->use_empty() && !Inst->getType()->isTokenTy())
> Inst->replaceAllUsesWith(UndefValue::get(Inst->getType()));
> - if (Inst->isEHPad()) {
>
> + if (Inst->isEHPad() || Inst->g...
2016 Sep 05
2
LLVM 3.8.0 - Adding new instruction to a basic block
...[where both I and new_inst are Instruction*]
>>
>> In LLVM 3.8 however, the SymbolTableList was created as a wrapper over
>> iplist.
>> Could anyone please tell me how I can do the same type of insertion in
>> LLVM 3.8?
>>
>
> auto InsertPt = I->getIterator();
> BB->getInstList().insert(InsertPt, new_inst);
>
>
Thanks, Daniel!
In your example, isn't "insert" inserting "new_inst" *before* instruction
"I"?
As I would like to insert the "new_inst" instruction after "I", shouldn't...
2015 Oct 20
2
ilist/iplist are broken (maybe I'll fix them?)
I think the implicit iterator conversions are much less important now that
we have range based for loops, but I still like having them.
On Tue, Oct 20, 2015 at 11:13 AM, Duncan P. N. Exon Smith via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
>
> > On 2015-Oct-07, at 17:57, Duncan P. N. Exon Smith <dexonsmith at apple.com>
> wrote:
> >
> > I've been
2020 Jun 17
2
InstCombine doesn't delete instructions with token
...Combine/InstructionCombining.cpp
> @@ -3012,7 +3012,7 @@ static bool prepareICWorklistFromFunction(Function
> &F, const DataLayout &DL,
> while (EndInst != BB->begin()) {
> // Delete the next to last instruction.
> Instruction *Inst = &*--EndInst->getIterator();
> - if (!Inst->use_empty())
> + if (!Inst->use_empty() && !Inst->getType()->isTokenTy())
> Inst->replaceAllUsesWith(UndefValue::get(Inst->getType()));
> - if (Inst->isEHPad()) {
>
> + if (Inst->isEHPad() || Inst->g...
2017 Mar 24
2
Problem about API difference between LLVM3.5 and LLVM3.9
...for each_custom(arg, *func, arg_begin, arg_end)
7 arg_list.push_back(&*arg);
8 for each(arg, arg_list){
9 Argument *arg_dup = new Argument((*arg)->getType(),
makeName(*arg, "_dup"));
10 func->getArgumentList().insertAfter((*arg)->getIterator(),
arg_dup);
11 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170324/6648b45b/attachment.html>
2016 Sep 04
2
LLVM 3.8.0 - Adding new instruction to a basic block
Hello,
I'm trying to add a new instruction after a given instruction in a basic
block.
Until LLVM 3.7, I was using the following code:
BB->getInstList().insertAfter(I, new_inst);
[where both I and new_inst are Instruction*]
In LLVM 3.8 however, the SymbolTableList was created as a wrapper over
iplist.
Could anyone please tell me how I can do the same type of insertion in LLVM
3.8?
2016 Sep 05
2
LLVM 3.8.0 - Adding new instruction to a basic block
...;
>>>> In LLVM 3.8 however, the SymbolTableList was created as a wrapper over
>>>> iplist.
>>>> Could anyone please tell me how I can do the same type of insertion in
>>>> LLVM 3.8?
>>>>
>>>
>>> auto InsertPt = I->getIterator();
>>> BB->getInstList().insert(InsertPt, new_inst);
>>>
>>>
>> Thanks, Daniel!
>>
>> In your example, isn't "insert" inserting "new_inst" *before* instruction
>> "I"?
>> As I would like to insert the...
2016 Feb 10
2
Question about an error we're now starting to get on LLVM 3.8.0rc2since
...e your out-of-tree call sites.
>> Note that these conversions are occasionally latent bugs (that may
>> happen to "work" now, but only because of getting lucky with UB;
>> follow-ups will change your luck). When they are valid, I suggest using
>> `->getIterator()` to go from pointer to iterator, and `&*` to go from
>> iterator to pointer.
>>
>>>
>>> Is this change indeed intended as a visible API change to source code generating references to argument list values? If so, can you point me to a description of h...
2016 Mar 14
4
LLVM 3.8 change in function argument lists?
Hi,
I am upgrading my project from 3.7 to 3.8. I find that following code
used to compile in 3.7 but doesn't in 3.8 and I can't understand why.
llvm::Function *mainFunc = ...;
auto argiter = mainFunc->arg_begin();
llvm::Value *arg1 = argiter++;
arg1->setName("obj");
But if I change the code to following it compiles:
auto argiter = mainFunc->arg_begin();
llvm::Value
2016 Feb 10
5
Question about an error we're now starting to get on LLVM 3.8.0rc2since
...patch downstream while you update your out-of-tree call sites.
Note that these conversions are occasionally latent bugs (that may
happen to "work" now, but only because of getting lucky with UB;
follow-ups will change your luck). When they are valid, I suggest using
`->getIterator()` to go from pointer to iterator, and `&*` to go from
iterator to pointer.
>
> Is this change indeed intended as a visible API change to source code generating references to argument list values? If so, can you point me to a description of how I should change our code? S...
2020 Jan 03
10
Writing loop transformations on the right representation is more productive
...analysis.
// In this case not really necessary since the green nodes of the
// loop bodies are reused.
DependenceAnalysis->transferAnalysis(Red1->getBody(),
RedFused->getBody()[0],
ClosedExprAnalysis->makeIdentityMapping(Red1->getIterator(),
RedFused->getIterator()));
DependenceAnalysis->transferAnalysis(Red2->getBody(),
RedFused->getBody()[1],
ClosedExprAnalysis->makeIdentityMapping(Red2->getIterator(),...
2018 Apr 09
2
Tablegen pattern: How to emit a SDNode in an output pattern?
I'm trying to write a tablegen pattern to that matches a sequence of
SDNodes and emits again an SDNode and another instruction.
The pattern I've written looks like the folowing:
def : Pat<(foo (bar GPR:$rs1), simm12:$imm1),
(bar (BAZ GPR:$rs1, simm12:$imm1))>;
foo and bar are SDNodes, BAZ is an instruction. In particular, bar is
defined as follows:
def bar :
2016 Feb 10
3
Question about an error we're now starting to get on LLVM 3.8.0rc2since
...sites.
>>>> Note that these conversions are occasionally latent bugs (that may
>>>> happen to "work" now, but only because of getting lucky with UB;
>>>> follow-ups will change your luck). When they are valid, I suggest using
>>>> `->getIterator()` to go from pointer to iterator, and `&*` to go from
>>>> iterator to pointer.
>>>>
>>>>>
>>>>> Is this change indeed intended as a visible API change to source code generating references to argument list values? If so, can you po...
2017 Jun 29
2
Ok with mismatch between dead-markings in BUNDLE and bundled instructions?
> On Jun 28, 2017, at 5:10 PM, Quentin Colombet via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
> Oh wait, vreg1 is indeed used.
> Yeah, having a dead flag here sounds wrong.
I mean on the instruction itself.
On the bundle, that’s debatable. That would fit the semantic “if no side effect you can kill it” (here there is side effect, we define other vregs).
>
>> On
2017 Jun 27
4
Ok with mismatch between dead-markings in BUNDLE and bundled instructions?
Hi Quentin and llvm-dev,
I've got a regalloc-related question that you might have an opinion or
answer about.
In our out-of-tree target we've been doing some bundling before register
allocation for quite some time now, and last night a new problem popped
up. What the fix should be depends on if this bundle is legal or not:
BUNDLE %vreg39<imp-def,dead>
*
2017 Nov 11
2
Update control flow graph when splitting a machine basic block?
Thank you for your reply!
> Every MachineBasicBlock has a list of successors; you can access it with
> the successors() accessor. That's what you should be using for any CFG
> analysis.
I am aware of these methods of class MachineBasicBlock, which allows one to access a MachineBasicBlock's successors and predecessors in the CFG.
But the CFG itself may no longer be valid if a