Mustakimur Khandaker via llvm-dev
2018-Apr-16 18:13 UTC
[llvm-dev] LLVM Alias Analysis (Load and store from same address is not showed up in same set)
Okay, I have tried the following:
bin/opt -mem2reg -basicaa -cfl-anders-aa -print-alias-sets bin/test/test.bc
But, the result is same as last time. Do you mean something like this to try?
Can you suggest what else could be an important factor for this issue?
Best Regards
Mustakimur Rahman Khandaker
Graduate Student and Teaching Assistant
Department of Computer Science
Florida State University
________________________________
From: Friedman, Eli <efriedma at codeaurora.org>
Sent: Monday, April 16, 2018 1:51:14 PM
To: Mustakimur Khandaker; llvm-dev at lists.llvm.org
Subject: Re: [llvm-dev] LLVM Alias Analysis (Load and store from same address is
not showed up in same set)
On 4/15/2018 11:44 AM, Mustakimur Khandaker via llvm-dev wrote:
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 -cfl-anders-aa -print-alias-sets bin/test/test.bc
I get the following result:
Alias sets for function 'ind_call':
Alias Set Tracker: 2 alias sets for 2 pointer values.
AliasSet[0x91a5820, 1] must alias, Mod/Ref Pointers: (i32 ()** %compr.addr,
8)
AliasSet[0x91a58c0, 2] may alias, Mod/Ref Pointers: (i32 ()** @fp, 8)
1 Unknown instructions: i32 %call
LLVM's alias analysis is not very smart; it depends on other optimization
passes to produce reasonable results. You should at least run mem2reg before
trying to do any alias analysis queries.
-Eli
--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux
Foundation Collaborative Project
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20180416/3b149eef/attachment.html>
Friedman, Eli via llvm-dev
2018-Apr-16 19:54 UTC
[llvm-dev] LLVM Alias Analysis (Load and store from same address is not showed up in same set)
On 4/16/2018 11:13 AM, Mustakimur Khandaker wrote:> > Okay, I have tried the following: > > bin/opt -mem2reg -basicaa -cfl-anders-aa -print-alias-sets > bin/test/test.bc > > But, the result is same as last time. Do you mean something like this > to try? Can you suggest what else could be an important factor for > this issue? >The functions in your IR are marked optnone because you compiled it at -O0, so mem2reg will refuse to transform them. If you need clang to generate unoptimized IR without the optnone flag, you can use "clang -O2 -mllvm -disable-llvm-optzns". -Eli -- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180416/26fc3a02/attachment.html>
Possibly Parallel Threads
- LLVM Alias Analysis (Load and store from same address is not showed up in same set)
- LLVM Alias Analysis (Load and store from same address is not showed up in same set)
- LLVM Alias Analysis (Load and store from same address is not showed up in same set)
- Effectiveness of llvm optimisation passes
- Effectiveness of llvm optimisation passes