Displaying 20 results from an estimated 9000 matches similar to: "Replace "while" "for" loops with "If-Else""
2017 Oct 22
2
Replace "while" "for" loops with "If-Else"
Hi weiren,
Thanks for your suggestion! Yes, I am trying to do this "nested
flattening". It seems that I need a post-dominator tree-based algorithm to
flatten the nested loops from the innermost to the outermost, level by
level.
Is there any feature already existed in LLVM tools? Or similar?
On Sun, Oct 22, 2017 at 2:31 AM, 陳韋任 <chenwj.cs97g at g2.nctu.edu.tw> wrote:
> If
2012 Apr 27
4
[LLVMdev] RE : Detect if a basicblock is part of a loop
Thx all for the quick answers...
> De : llvmdev-bounces at cs.uiuc.edu [llvmdev-bounces at cs.uiuc.edu] de la part de Arnaud ALLARD DE GRANDMAISON [arnaud.allarddegrandmaison at parrot.com]
>
> Hi,
>
> Depending on what have run before your pass, the loop may have been unrolled or simplified if the computation inside the loop is too simple.
>
> Cheers,
> --
> Arnaud de
2012 Apr 27
2
[LLVMdev] RE : RE : Detect if a basicblock is part of a loop
This is my main.c (just a crappy test file):
#include <stdlib.h>
void foo() {
foo();
}
int main(int argc,char** argv) {
int a = 1;
int b = 3;
int c = a+b;
int k;
for(k=0;k<10;++k) { // The loop I'm trying to detect
int sdf = 123123;
c++;
}
if(c - atoi(argv[1])
2012 Aug 27
0
[LLVMdev] where can I find out the documents of how to write a llvm regression test case?
> 2.i want to write such a test:translate a *.ll(i.e:hello.ll) file to a
> *.c file(i.e:hello.c) with llc,then verify if the .c file contian a
> certain string(i.e:"abc:). so:
It seems you want to test LLVM C backend, go looking for
llvm-3.0.src/test/CodeGen/CBackend/* (C backend had been
removed from LLVM 3.1).
HTH,
chenwj
--
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute
2012 Apr 27
0
[LLVMdev] RE : RE : Detect if a basicblock is part of a loop
> Yes it's my own lib... It contains some obfuscation's passes. The one I'm trying to make now is making code flattening!
^^^^^^^^^^^^^^^^^^^^^^
What's the flattening effect? Maybe try NOT to flat it first?
Regards,
chenwj
--
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute
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:
2013 Feb 27
3
[LLVMdev] CGO Tutorial on MCLinker and LLVM 2013 - Slides are now available
Hi all,
The slides we used on "CGO MCLinker and LLVM Tutorial" are now
available on the MCLinker website:
http://code.google.com/p/mclinker/wiki/2013CGOTutorial
Enjoy!
- The CGO Tutorial on MCLinker and LLVM 2013 committee
2012 Apr 27
0
[LLVMdev] RE : Detect if a basicblock is part of a loop
> Just as I said to Hal, nothing else than:
> $ clang -emit-llvm -S -o main.ll main.c
> $ ../build/Release/bin/opt -load ../build/Release/lib/LLVMobfuscationTest.so -flattening -S main.ll -o main.opt.ll
Then you might need to past your main.c. Besides, is LLVMobfuscationTest.so
your own pass? What does it do?
Regards,
chenwj
--
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of
2018 Jan 15
1
Source level code transformation V.S. IR-level code transformation
Thanks Weiren!
My goal is to transform the code automatically by doing some code
analysis, instead of rewriting it manually.
To do this source level auto transformation, do you have any
suggestions on what tool to use? Thanks again!!
On Mon, Jan 15, 2018 at 04:25 陳韋任 via llvm-dev <llvm-dev at lists.llvm.org>
wrote:
> 2018-01-15 9:36 GMT+08:00 Linchuan Chen via llvm-dev <
2017 Oct 22
2
How to dump broken IR from LLVM backend?
You can also `-disable-verify -o <output-filename> ` which will disable the
verify check.
On Sat, 21 Oct 2017 at 23:54 Dipanjan Das via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
>
> Yes, that definitely works. Wanted to know if there's a switch for file
> output or not.
>
> On 21 October 2017 at 23:45, 陳韋任 <chenwj.cs97g at g2.nctu.edu.tw> wrote:
>
2012 Aug 27
4
[LLVMdev] where can I find out the documents of how to write a llvm regression test case?
hi,chen:
thaks for your explaining,after reading it i have a few problems more.
1.in the sentenses of "X32: subl $-128, %eax" and "; X64: subl
$-128," ,i do not know what means that in detail,these sentences were
writen follow which language rules?
2.i want to write such a test:translate a *.ll(i.e:hello.ll) file to a
*.c file(i.e:hello.c) with llc,then verify if the .c
2017 Oct 22
2
How to dump broken IR from LLVM backend?
Just use Unix IO redirect? `llc -mllvm -print-after-all &> a.txt`
2017-10-22 14:17 GMT+08:00 Dipanjan Das via llvm-dev <
llvm-dev at lists.llvm.org>:
>
> Seems like "-mllvm -print-after-all" does the trick. Is there any switch
> that dumps the output to a file instead of console?
>
> On 21 October 2017 at 21:33, Dipanjan Das <mail.dipanjan.das at
2012 Apr 27
0
[LLVMdev] RE : Detect if a basicblock is part of a loop
> I'm running opt with my lib on a ir code emmitted by clang: $ clang -emit-llvm -S -o main.ll main.c
> and opt: $ ../build/Release/bin/opt -load ../build/Release/lib/LLVMobfuscationTest.so -flattening -S main.ll -o main.opt.ll
What's the clang default opt level? Maybe you should use "-O0" explicitly.
Regards,
chenwj
--
Wei-Ren Chen (陳韋任)
Computer Systems Lab,
2018 Jan 15
0
Source level code transformation V.S. IR-level code transformation
2018-01-15 9:36 GMT+08:00 Linchuan Chen via llvm-dev <
llvm-dev at lists.llvm.org>:
> Dear all,
> I'm working on a simple code transformation problem that can be
> described as below:
>
> for a C++ loop:
>
> *for (int i = 0; i < N; ++i) {*
> * a = M[i] + b;*
> * }*
>
> I want to transform it to:
>
> *int A[4]; *
2018 Jan 15
3
Source level code transformation V.S. IR-level code transformation
Dear all,
I'm working on a simple code transformation problem that can be
described as below:
for a C++ loop:
*for (int i = 0; i < N; ++i) {*
* a = M[i] + b;*
* }*
I want to transform it to:
*int A[4]; *
* for (int i = 0; i < N; ++i) {*
* A[0] = M[i] + b;*
* A[1] = M[i] + b;*
* A[2] = M[i] + b;*
* A[3] = M[i] + b;*
*
2014 Feb 08
3
[LLVMdev] SCEV implementation and limitations, do we need "pow"?
On 2/7/14, 10:24 AM, Andrew Trick wrote:
>
> On Feb 5, 2014, at 12:54 AM, Mehdi Amini <mehdi.amini at silkan.com
> <mailto:mehdi.amini at silkan.com>> wrote:
>
>> Hi,
>>
>> I was looking at some bugs to play with, and I started with
>> http://llvm.org/bugs/show_bug.cgi?id=18606
>>
>> As I commented there, a loop is unrolled and exhibit
2011 Jan 11
0
[LLVMdev] VMKit link
Hi,
I guess you miss "-lpthread"?
Regards,
chenwj
--
Wei-Ren Chen (陳韋任)
Parallel Processing Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
2017 Jun 09
2
[Newbie Question] Compute a schedule region's scheduled cycles.
Also you might need to check use PostRASchedulerList or
PostMachineScheduler,
PostRASchedulerList is considered deprecated as mentioned in [1].
[1] http://lists.llvm.org/pipermail/llvm-dev/2017-April/112348.html
HTH,
chenwj
2017-06-10 4:03 GMT+08:00 陳韋任 <chenwj.cs97g at g2.nctu.edu.tw>:
> Not saying I am totally understand how thing works, but I think you're
> misleading
>
2017 Oct 13
2
Why does GEP allow src and destination type to have different address spaces?
The GEP constructor does not assert that the source and destination types
match. Of course, this is incorrect and causes random failures somewhere
down the line.
Could I add general sanity checks to the GEP constructor?
In general, is an Instruction allowed to be in an inconsistent state? If
so, is there some well known method to "verify" whether an instruction is
consistent or not?
2014 Feb 05
2
[LLVMdev] SCEV implementation and limitations, do we need "pow"?
Hi,
I was looking at some bugs to play with, and I started with
http://llvm.org/bugs/show_bug.cgi?id=18606
As I commented there, a loop is unrolled and exhibit this pattern:
%mul.1 = mul i32 %mul, %mul
%mul.2 = mul i32 %mul.1, %mul.1
....
With an unroll factor of 32, the last multiply has 2^32 terms in its
SCEV expression.
(I mean I expect it would have those terms if I was patient