similar to: [LLVMdev] Given alias knowledge, how to optimize?

Displaying 20 results from an estimated 100000 matches similar to: "[LLVMdev] Given alias knowledge, how to optimize?"

2012 Aug 11
1
[LLVMdev] which LLVM transforms can optimize this code?
In principle, transform passes are not responsible to inspect @yyy is not aliased to @XXX. I guess "opt -basicaa -{any-transform-passes}" would help you. You may also try "opt -{any-analysis-passes} -aa-eval}" Note, opt is the tool not for users but for developers. He does not invoke unspecified passes automatically. ...Takumi 2012/8/11 Jun Koi <junkoi2004 at
2012 Aug 11
2
[LLVMdev] which LLVM transforms can optimize this code?
hi, i am trying to optimize the below code, in one of my LLVM functions: .... store i32 96, i32* @XXX, align 4 ; (1) store i32 117, i32* @yyy, align 4 ; (2) store i32 31, i32* @XXX, align 4 ; (3) .... naturally, optimize passes should remove the line (1), because later line (3) overwrites the value of the same global variable XXX. i run this code via "opt" with option
2012 Aug 11
0
[LLVMdev] which LLVM transforms can optimize this code?
On Sat, Aug 11, 2012 at 7:42 PM, Jun Koi <junkoi2004 at gmail.com> wrote: > hi, > > i am trying to optimize the below code, in one of my LLVM functions: > > .... > store i32 96, i32* @XXX, align 4 ; (1) > store i32 117, i32* @yyy, align 4 ; (2) > store i32 31, i32* @XXX, align 4 ; (3) > .... > > naturally, optimize passes should remove the
2016 Jul 04
2
Optimization issues (Alias Analysis?)
Hey, I am currently working on a VM which is based on LLVM and I would like to use its optimizer, but it somehow it can't detect something very simple (I guess.) This is the LLVM IR: target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128" target triple = "i386-unknown-linux-gnu" %struct.regs = type { i32, i32, i32 } define void @Test(%struct.regs* noalias
2012 Sep 20
3
[LLVMdev] TBAA fail on optimization, why?
hi, i have a simple code like below, in wich variable "aaa" does not alias to "bbb". i use TBAA to specify this, please see the code. then i ran this code thru LLVM optimization, and i expected that the second "store" instruction is eliminated. however, i am wrong: the second "store" instruction is still there after optimization. perhaps my TBAA setup is
2015 Apr 10
2
[LLVMdev] LLVM Alias Analysis
Hi Xin, Thank you for your reply! I have tried the 3 alias analyses you have mentioned on LLVM 3.5: 1) $ opt -globalsmodref-aa -aa-eval < xxx.bc > /dev/null (May-alias response 100%) 2) $ opt -tbaa -aa-eval < xxx.bc > /dev/null (May-alias response 100%) 3) $ opt -cfl-aa -aa-eval < xxx.bc> /dev/null (Unknown command line argument '-cfl-aa') It seems that they are not
2007 Jun 25
2
[LLVMdev] Question about Alias Analysis
Hi! I'm currently working on developing a new technique for alias analysis and wish to know how to compare it's results to the results that LLVM gets. The algorithm I have operates on LLVM assembly (I wrote the analysis in Haskell, so unfortunately I can't embed it into LLVM very easily). I tried using the option to print alias sets, but I'm not quite sure how to interpret the
2020 Jul 23
2
How to optimize out the duplicated memory load instructions?
Hi Johannes, Thanks for your help. I tried with something like below and nothing changes. Maybe I am doing something wrong? 246001 check_exce_succ59: ; preds = %check_exce_succ40 **246002 %mem_base60 = load i8*, i8** %mem_base_addr_ptr, align 8, !alias.scope !3 246003 %offset161 = add i32 %call56, 4 246004 %12 = sext i32 %offset161 to i64 246005 %maddr62 =
2007 Jun 26
0
[LLVMdev] Question about Alias Analysis
On Mon, 25 Jun 2007, Ben Chambers wrote: > I guess what confuses me is that it doesn't seem like it was able to > figure out that *b = a. Am I looking at this wrong? Is there a more > accurate way of getting the alias information out of the pass? The answer is to not look at the alias sets. I'd suggest looking at the raw results of alias queries. To do this, use the -aa-eval
2016 Feb 10
4
Memory Store/Load Optimization Issue (Emulating stack)
Thank you for the hint. I adjusted the code and it works: The code after replacing inttoptr with getelementptr: define { i32, i32, i8* } @test(i32 %foo, i32 %bar, i8* %sp) { entry: ; push foo (On "stack") %sp_1 = getelementptr i8, i8* %sp, i32 -4 %sp_1_ptr = bitcast i8* %sp_1 to i32* store i32 %foo, i32* %sp_1_ptr, align 4 ; push bar %sp_2 = getelementptr i8, i8* %sp_1,
2016 Feb 10
2
Memory Store/Load Optimization Issue (Emulating stack)
Thanks for the answers. Although I am not sure if I've understood the docs about how inttoptr/ptrtointr are different when compared to gep. It says: "It’s invalid to take a GEP from one object, address into a different separately allocated object, and dereference it.". To go back to my intention why I am doing this, I would like to "emulate" some x86 instructions with
2007 Jun 27
1
[LLVMdev] Question about Alias Analysis
Thanks, that's a lot more like the output I was expecting. But, I'm now wondering if I'm doing something wrong because the output confuses me. When run on the program: int main() { int a = 5; int* b = &a; int* c = &a; return *b; } I would expect to see either b may alias c or b must alias c. But, it doesn't even appear in the list. Furthermore, I would expect
2020 Jul 23
2
How to optimize out the duplicated memory load instructions?
Hi Johannes, Silly as me. I just figured out how to correctly use 'alias' metadata. I should define them in IR like below: !3 = !{!3} !4 = !{!4} !5 = !{!5, !3} !6 = !{!6, !4} And then use !5 and !6. The below usage is wrong: !3 = !{!3} !4 = !{!4} Then use !3 and !4 in IR. BR, Terry On Fri, Jul 24, 2020 at 12:12 AM Johannes Doerfert < johannesdoerfert at gmail.com> wrote:
2010 Feb 14
4
[LLVMdev] A very basic doubt about LLVM Alias Analysis
to compile it to bitcode I give the following command : llvm-gcc -emit-llvm -c -o s.bc s.c and then I run different alias analysis passes like -anders-aa, -basicaa using following: opt -anders-aa -aa-eval -print-all-alias-modref-info s.bc From this I get the following output: Function: main: 8 pointers, 1 call sites NoAlias: i32* %retval, i32** %j NoAlias: i32* %retval, i32**
2016 Feb 12
2
Memory Store/Load Optimization Issue (Emulating stack)
Hi again, So I finally gave up on trying to get through the converting (x86' push pop mov add) because it deals a lot with crazy pointer arithmetics and sonce inttoptr and ptrtoint doesn't provide any alias analysis information. Daniel, you said it doesn't make much sense to provide it but in my cases it is actually very much needed, you didn't say it wasn't possible to
2011 Nov 03
4
[LLVMdev] Alias Analysis Problem in LICM
Hi, I met an alias analysis problem in the LICM phase. I am using the following piece of code to present this problem. 1 int size; 2 int ** AAA; 3 void * xalloc(int); 4 5 void foo(void) 6 { 7 int i; 8 AAA = (int**) xalloc(size * sizeof(int*)); 9 10 for (i=0; i<size; i++) 11 AAA[i] = 0; 12 } This code tries to
2015 Apr 27
4
[LLVMdev] alias set collapse and LICM
I'm current facing an issue related to AliasSetTracker/LICM: the transitive closure of the alias sets is materially more conservative than individual aliasing queries and this conservatism leads to generally worse optimization in LICM. For instance, consider this module: declare i32 @only_reads() readonly declare void @escape(i32*, i32*, i32*) define void @f(i32 %count) { entry: %a =
2020 Jul 23
2
How to optimize out the duplicated memory load instructions?
Hi there, The raw input IR is composed by my tool and the below one is produced by llvm opt tool with O3 optimization level. I am pretty sure that the two load instructions( %mem_base60 and %mem_base66) are referring to the same memory location. How can I instruct llvm optimization pass to optimize out the %mem_base66 and make the subsequent code reuse the %mem_base60? I tried with metadata
2018 Apr 15
2
LLVM Alias Analysis (Load and store from same address is not showed up in same set)
Hi I have this simple c code for which I would like to use for alias analysis. #include <stdio.h> #include <stdlib.h> static int (*fp) (void); void ind_call (int (*compr)(void)){ fp = compr; fp(); } int hello(void){ return printf("hello world\n"); } int main(){ ind_call(hello); return 0; } So, I do the following: bin/opt -basicaa
2012 Sep 27
2
[LLVMdev] TBAA fail on optimization, why?
On Thu, Sep 27, 2012 at 3:31 PM, Duncan Sands <baldrick at free.fr> wrote: > Hi Jun, > > > On 27/09/12 08:02, Jun Koi wrote: >> >> On Thu, Sep 20, 2012 at 5:18 PM, Duncan Sands <baldrick at free.fr> wrote: >>> >>> Hi Jun, did you tell "opt" to make use of TBAA? Also, please give >>> complete >>> IR >>> that