search for: instlist

Displaying 8 results from an estimated 8 matches for "instlist".

2016 Aug 25
2
InstList insert depreciated?
...I am facing issues resolving the following: To insert an instruction immediately after the first instruction within a basic block, I first get all instructions in my basic block in an instruction container list. Once that is done, I insert my new instruction in the instruction container list using InstList.insert(). // code void FSliceModulePass::allocaVSetArray(void) { auto &B = F->getEntryBlock(); auto &IList = B.getInstList(); auto &FirstI = *IList.begin(); auto TaintVar = new AllocaInst(IntPtrTy, FirstI); IList.insert(FirstI, TaintVar); // ERROR After migrating to 3...
2016 Aug 25
2
InstList insert depreciated?
...llvm-dev wrote: >> >> I tried an alternative way of adding instruction by first getting the >> first instruction of the basic block, and then calling insertAfter() >> on it as follows: >> >> auto &B = F->getEntryBlock(); >> auto &IList = B.getInstList(); >> auto &FirstI = *IList.begin(); >> auto TaintVar = new AllocaInst(IntPtrTy); >> // IList.insert(FirstI, TaintVar); // OLD >> FirstI.insertAfter(TaintVar); // NEW > > > You want: > > TaintVar->insertAfter(FirstI); > > > J...
2005 May 11
3
[LLVMdev] Question About inserting Instruction?
...ructions to dummy/dead BB, however, I really want to insert some illegal instructions/any thing into those BB since those instructions have no chance to be executed. I am not sure if it could be done or not. For example, Correct way: Instruction *NewInst = new LoadInst(...); NewBB->getInstList().push_back(NewInst); what I need just put some junk data in the BB, not instructions. From assemble code level, it looks like the following, a piece of code from correct instructions by disassemble object code. :00000009 0533709283 add eax, 83927033 :0000000E 05A2B78135...
2006 May 17
0
[LLVMdev] Obfuscation with LLVM
...should be placed at the beginning of the function and should dominate // all their uses. for( BasicBlock::iterator i = oldEntryBB->begin(); i != oldEntryBB->end(); ) { if( AllocationInst* ai = dyn_cast< AllocationInst >( i ) ) { oldEntryBB->getInstList().remove( i++ ); // Trick to preserve the valid iterator after removing an element. newEntryBB->getInstList().push_back( ai ); } else { i++; } } oldEntryBB->setName( "old_entry" ); return newEntryBB; } void...
2009 Jan 16
1
[LLVMdev] Problem using ilist container
Hi All, I have just started using LLVM . i am facing a issue while using ilist container. Here is a struct with ilist container as its one element. typedef ilist<Instruction *> InstListType; struct list_node { int Impact; InstListType InstList; }; list_node *BB_list=new struct list_node[10]; Instruction *user= { pointing to some instruction object } //trying...
2020 Jun 24
7
[RFC] Compiled regression tests.
...9;s results (which currently we do not have tests for) and could also be compiled in debug mode while LLVM itself is compiled in release mode. The checks themselves can be any of gtest's ASSERT/EXPECT macros, but for common test idioms I suggest to add custom macros, such as ASSERT_ALL_OF(InstList, !isa<VectorType>(I->getType())); which on failure prints the instruction that does not return a vector. Try that with FileCheck. PattenMatch.h from InstCombine can be used as well. Structural comparison with a reference output could also be possible (like clang-diff, [llvm-canon](http://...
2014 May 15
2
[LLVMdev] SROA is slow when compiling a large basic block
On Thu, May 15, 2014 at 9:31 AM, Philip Reames <listmail at philipreames.com>wrote: > On 05/14/2014 06:02 PM, Akira Hatanaka wrote: > > I would like to get feedback from the community on how I can speed up > the compilation of a function that has one huge basic block consisting of > over 150K instructions. It takes about 10 minutes for clang to produce the > object file
2005 May 11
2
[LLVMdev] Re:RE: Question about inserting instructions
Hi, Thanks Volodya, Misha and Chris, > > For example, > > Correct way: > > Instruction *NewInst = new LoadInst(...); > > NewBB->getInstList().push_back(NewInst); > > > > what I need just put some junk data in the BB, not instructions. From > > assemble code level, it looks like the following, > > > > a piece of code from correct instructions by disassemble object code. > > > > :0000000...