Displaying 20 results from an estimated 4000 matches similar to: "[LLVMdev] IR code modification/transformation"
2011 Aug 11
0
[LLVMdev] RE : IR code modification/transformation
Re-adding the list, below message was sent to me alone:
On 11 August 2011 13:45, Rinaldini Julien <julien.rinaldini at heig-vd.ch> wrote:
> Thx for all answers...
>
> I'll try that. But in a long term what I want to do will be a bit more complicated... It was just an example. In this case, the goal is to replace all add with sub that return the same result, like:
>
> var
2015 Mar 24
2
[LLVMdev] Propagate clang attribute to IR
> On 24 Mar 2015, at 14:55, Aaron Ballman <aaron at aaronballman.com> wrote:
>
> On Tue, Mar 24, 2015 at 9:48 AM, Rinaldini Julien
> <julien.rinaldini at heig-vd.ch> wrote:
>> Hi,
>>
>> I want to *tag* some functions with some *flags*. I was using annotate((“myFlag”)) and everything was working fine until I tried on ObjC method. It seems that clang just
2012 Apr 26
2
[LLVMdev] Detect if a basicblock is part of a loop
Hi,
I'm trying to detect if a basicblock is part of a loop or not.
I tried the llvm::LoopInfo like that (http://llvm.org/docs/doxygen/html/classllvm_1_1LoopInfo.html#a4abca289c73cd09487e05d11d9f7d877):
LoopInfo *loop = new LoopInfo();
bool isLoop = loop->getLoopFor(myBB); // getLoopFor - Return the inner most loop that BB lives in. If a basic block is in no loop (for example the entry
2012 Apr 26
0
[LLVMdev] Detect if a basicblock is part of a loop
Rinaldini,
What exactly did you run? Specifically, you may be missing some
analysis passes that are necessary for LoopInfo to have the loop
information you desire.
-Hal
On Thu, 26 Apr 2012 14:02:04 +0000
Rinaldini Julien <julien.rinaldini at heig-vd.ch> wrote:
> Hi,
>
> I'm trying to detect if a basicblock is part of a loop or not.
>
> I tried the llvm::LoopInfo
2014 Mar 26
2
[LLVMdev] Linking problem
Hi,
I'm writing a pass that implements a jump table with an array of
blockaddress and an indirectbr instruction.
It get a blockaddress in the array (via getelementptr and an index) and
then jump to this basicblock via the indirectbr.
I tried to compile several libraries to test my pass and the run their
test-suite. It works fine with, for e.g, libTomCrypt (in -O0,1,2,3).
With GMP or
2014 Oct 29
2
[LLVMdev] Problem in X86 backend (again)
>> // Increment loop variable and jmp
>> BuildMI(*MBB_erase, MBB_erase->end(), db, >> TII->get(X86::ADD64ri32),reg).addReg(reg).addImm(8);
>
> It looks like this instruction is defining virtual register "reg" the second time.
Thx for your answer...
Why would it define it again? I just want to use this register and add something to it...
Cheers
2012 Apr 26
2
[LLVMdev] Detect if a basicblock is part of a loop
Hi Rinaldini,
In order to find information about loops inside a given function you should use something like "LoopInfo *LI = P->getAnalysis<LoopInfo>()", remembering to add "AU.addRequired<LoopInfo>();" to your getAnalysisUsage method.
If the function you are interested to is not located in the module being compiled (if you created it as an auxiliary function,
2015 Mar 24
2
[LLVMdev] Propagate clang attribute to IR
Hi,
I want to *tag* some functions with some *flags*. I was using annotate((“myFlag”)) and everything was working fine until I tried on ObjC method. It seems that clang just ignore it.
So, to be able to *flag* my functions I’m trying to add a *real* attribute to clang.
I’ve added a new attribute to clang in tools/clang/include/clang/Basic/Attr.td:
def NoFLA : Attr {
let Spellings =
2012 May 08
2
[LLVMdev] RE : RE : svn trunk comilation error
> De : 陳韋任 [chenwj at iis.sinica.edu.tw]
> Date d'envoi : mardi 8 mai 2012 11:37
> À : Rinaldini Julien
> Cc: LLVM Developers Mailing List
> Objet : Re: [LLVMdev] RE : svn trunk comilation error
>
> Hi Rinaldini,
>
> You probably need to illustrate what your enviroment is, what revision you
> checkout and how you build LLVM. I have no problem build LLVM svn here.
2012 May 09
0
[LLVMdev] RE : RE : RE : svn trunk comilation error
> De : 陳韋任 [chenwj at iis.sinica.edu.tw]
> Date d'envoi : mardi 8 mai 2012 11:37
> À : Rinaldini Julien
> Cc: LLVM Developers Mailing List
> Objet : Re: [LLVMdev] RE : svn trunk comilation error
>
> Hi Rinaldini,
>
> You probably need to illustrate what your enviroment is, what revision you
> checkout and how you build LLVM. I have no problem build LLVM svn here.
2012 Apr 27
1
[LLVMdev] RE : RE : RE : Detect if a basicblock is part of a loop
It try to put all basicblock in a switch in a loop, like that for example:
int main() {
if(something)
somethingelse:
else
another;
}
become:
int main() {
while(true) {
switch(var) {
case 0:
if(something)
var+=1;
else:
var+=2;
break;
case1:
2012 Jun 13
2
[LLVMdev] llvm-mc problem after a pass
Hi,
I'm having some problem with llvm-mc on a program after applying a pass:
../../../build/Release+Asserts/bin/clang -emit-llvm -c -I./testprof/ -I./src/headers/ -I../libtommath-0.42.0/ -Wall -Wsign-compare -W -Wshadow -Wno-unused-parameter -DLTC_SOURCE -O0 -DLTC_NO_ASM -DUSE_LTM -DLTM_DESC -o src/pk/asn1/der/sequence/der_encode_sequence_ex.bc
2012 Jun 13
0
[LLVMdev] llvm-mc problem after a pass
Something is adding a bogus comment string. Specifically " # %case^M18 ", where "^M" is a single ctrl-M character.
The ^M is seen by the asm parser as an end-of-line, so the '18' is a new token at the start of a line, not part of the comment. Is your pass perhaps using label names which might include literal "^M" characters?
-Jim
On Jun 13, 2012, at
2013 May 13
1
[LLVMdev] Problem with MachineFunctionPass and JMP
Hi !
I'm trying to modify the code in a machine function pass…
I added a new basicblock and I want to add a jump to an another BB from my new BB.
Here is my code :
bool Obfuscation::runOnMachineFunction(MachineFunction &MF) {
MachineBasicBlock *newEntry = MF.CreateMachineBasicBlock();
MF.insert(MF.begin(), newEntry);
std::vector<MachineBasicBlock*> origBB;
2014 Oct 29
2
[LLVMdev] Problem in X86 backend
Hi Julien,
> On Oct 28, 2014, at 2:14 AM, Rinaldini Julien <julien.rinaldini at heig-vd.ch> wrote:
>
> Hum, in fact, I'm still a bit lost ;)
>
> It seems to works in -O0, but in -O1, -O2 and -O3, I got this error (+ the dump of the function):
>
> # Machine code for function foo: Post SSA
> Function Live Ins: %RDI in %vreg7
>
> BB#0: derived from LLVM BB
2012 May 23
3
[LLVMdev] LLVM test a pass
Hi,
I'm currently developping a pass for LLVM and I was wondering what's the best way to test if it work correctly.
Right now to test my pass, I'm compiling libtomcrypt with LLVM and an other time LLVM+my pass. After that I run the test framework of libtomcrypt
and compare the result.
Is there a best way to do that? Maybe using the test suite from LLVM is better (I tought it used
2012 Jul 16
1
[LLVMdev] Merge 2 BasicBlocks
Hi!
I'm trying to merge 2 basicblocks. I look in BasicBlockUtils.h but the merge function does not what I want.
I'm trying to merge basicblock from a switch where the 'case' have no break, from that:
int a;
switch(c) {
case 3:
a=1;
case 2;
b=1;
case 1:
c=1;
}
to that:
int a;
switch(c) {
case 3:
a=1;
b=1;
c=1;
2013 Feb 27
1
[LLVMdev] Compilation problem when addind a library
Hi !
Here is the situation. I created a pass in lib/Transforms/Obfuscation. I added a createFlattening() in IPO.h and in my code
to be able to use it in PassManagerBuilder.cpp (lib/Transforms/IPO) in the method PopulateModulePassManager() so I can add my pass to standard passes.
It all works if I add all my files in the lib/Transforms/IPO directory.
But I want to keep them away in the
2012 Aug 20
3
[LLVMdev] Problem with "Does not dominate all uses"
Hi!
I'm having some trouble with a pass I'm writing.
I'm using DemotePHIToStack to remove all phi node in my code with this code (this is the first thing I do in my pass):
// Erase phi node
vector<PHINode*> phis;
for (Function::iterator i=f->begin();i!=f->end();++i) {
for(BasicBlock::iterator b=i->begin();b!=i->end();++b) {
2014 Dec 10
2
[LLVMdev] Virtual register problem in X86 backend
Hi,
Thx for your help...
Here is the IR code:
; ModuleID = 'foo_bar.c'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"MAIN\0A\00", align 1
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** %argv) #0 {
entry:
%retval = alloca i32,