Displaying 20 results from an estimated 60000 matches similar to: "[LLVMdev] CallGraphSCC passes and function passes"
2007 Aug 15
3
[LLVMdev] c const
I don't mean to be a pain, but I was thinking about this a bit more.
Does gcc ignore the const keyword? If not, why has LLVM chosen to
deviate from gcc with respect to the const keyword? If so, then why do
we bother using const in LLVM API code? I'm just curious and wanted to
understand the thinking behind not preserving const.
Thanks,
Ryan
Chris Lattner wrote:
> This property
2007 Aug 15
0
[LLVMdev] c const
I don't follow what you mean - gcc doesn't ignore const and llvm
doesn't deviate from gcc nor from the relevant language standards.
Note that if you declare a global as const that we do capture this in
the ir - what specifically do you want? Please provide an example.
-Chris
http://nondot.org/sabre
http://llvm.org
On Aug 14, 2007, at 11:58 PM, "Ryan M. Lefever"
2007 Aug 08
0
[LLVMdev] c const
This property isn't preserved on the llvm ir, because const can always
be cast away. If you want mod information, then I suggest using the
aliasanalysis interface to get mod ref info for a call.
-Chris
http://nondot.org/sabre
http://llvm.org
On Aug 8, 2007, at 12:07 AM, "Ryan M. Lefever" <lefever at crhc.uiuc.edu>
wrote:
> How is c's const keyword translated
2007 Aug 08
2
[LLVMdev] c const
Hi,
I think I found a bug. I don't know if it's in upstream gcc or llvm-gcc4.
int func()
{
const int *arr;
arr[0] = 1;
}
$ llvm-gcc main.c -c; echo $?
0
$ gcc main.c -c
main.c: In function 'func':
main.c:4: error: assignment of read-only location
The difference disappears when arr[0] is replaced by *arr.
(I tried the above with gcc 4.1.2, 3.4.6, 4.0.3. (I don't
2007 Aug 10
2
[LLVMdev] c const
This certainly doesn't occur in gcc mainline.
In fact, I improved the error message, and added a error test to gcc
just yesterday.
On 8/9/07, Chris Lattner <sabre at nondot.org> wrote:
> On Wed, 8 Aug 2007, Nikhil A. Patil wrote:
> > I think I found a bug. I don't know if it's in upstream gcc or llvm-gcc4.
>
> Looks like a bug, please file a bugzilla entry.
>
2007 Aug 08
5
[LLVMdev] c const
How is c's const keyword translated when compiling c into llvm bytecode.
I'm specifically interested in const pointer function arguments.
Consider a function declared as follows in c:
void f(const int* arg);
When I examine f in llvm bytecode, how can I tell that arg is a pointer,
whose contents can only be read, not written.
Regards,
Ryan
2007 Aug 09
0
[LLVMdev] c const
On Wed, 8 Aug 2007, Nikhil A. Patil wrote:
> I think I found a bug. I don't know if it's in upstream gcc or llvm-gcc4.
Looks like a bug, please file a bugzilla entry.
-Chris
> int func()
> {
> const int *arr;
> arr[0] = 1;
> }
>
> $ llvm-gcc main.c -c; echo $?
> 0
>
> $ gcc main.c -c
> main.c: In function 'func':
> main.c:4: error:
2007 Aug 10
0
[LLVMdev] c const
On Thu, 9 Aug 2007, Daniel Berlin wrote:
> This certainly doesn't occur in gcc mainline.
> In fact, I improved the error message, and added a error test to gcc
> just yesterday.
Yep, clang reports:
t.c:4:12: error: read-only variable is not assignable
arr[0] = 1;
~~~~~~ ^
1 diagnostic generated.
so this is specific to llvm-gcc somehow.
-Chris
> On 8/9/07, Chris
2006 Sep 27
2
[LLVMdev] dependent passes
I think that we are talking about two different things. I understand
that in order to use LLVM classes you must either qualify them with the
llvm namespace or use the statement "using namespace llvm;" What I'm
saying is that it has been my experience that when a pass Y depends on
another pass X, i.e, Y is a required analysis of X, then Y must be
defined within the llvm
2006 Dec 04
1
[LLVMdev] problem using scc_iterator on CallGraph
I printed the call graph as you suggested. The bugpoint bytecode that I
sent below prints the following call graph:
Indirect call node
/ | | \
/ | | \
V | V V
execute | prog_char clear_func
| |
V V
push_constant
|
V
Node0x8d7b370
i.e.,
Indirect call node -> execute
2006 Sep 25
1
[LLVMdev] llvm passes
So, am I correct that the implication of what you're saying is that if
pass X requires pass Y, then pass Y does not necessarily run to
completion on every component of a program, before pass X runs.
Furthermore, if those passes X and Y are both function passes, then when
pass X runs on function F, the last function Y will have run on is
function F.
Chris Lattner wrote:
> On Fri, 22
2007 Aug 22
1
[LLVMdev] llvm-gcc-4.0 compilation erros
Chris,
I'm a little confused. I am experiencing a crash when compiling the
llvm-gcc frontend. According to the bugpoint documentation, bugpoint is
used to debug "optimizer crashes, miscompilations by optimizers, or bad
native code generation," which seems like it implies that the frontend
compiles. Also, the http://llvm.org/docs/HowToSubmitABug.html
documentation seems to
2006 Oct 16
2
[LLVMdev] alias analysis
Since Data Structure alias analysis inherits from ModulePass rather than
FunctionPass, does that mean that it performs interprocedural alias
analysis? Further, if I compare pointers from two different functions,
will I sometimes get a NoAlias response.
Regards,
Ryan
--
Ryan M. Lefever [http://www.ews.uiuc.edu/~lefever]
2006 Sep 22
2
[LLVMdev] llvm passes
In the instructions for writing LLVM passes, it says "[c]urrently it is
illegal for a ModulePass to require a FunctionPass. This is because
there is only one instance of the FunctionPass object ever created, thus
nowhere to store information for all of the functions in the program at
the same time."
I'm a little confused by that. It was my understanding that if pass X
required
2008 Nov 04
3
[LLVMdev] fPIC
Does llvm-gcc support the -fPIC option? I am using LLVM on both 32 bit
linux and 64 bit linux, if that matters.
Regards,
Ryan
--
Ryan M. Lefever [http://www.crhc.uiuc.edu/~lefever/index.html]
2009 Apr 28
3
[LLVMdev] O3 passes
I assume that when -O3 (or O2 or O1) is passed to llvm-gcc, then it
utilizes opt. How do I determine what passes opt runs? How do I
determine what external tools (and arguments) llvm-gcc is invoking?
Regards,
Ryan
2009 Apr 28
3
[LLVMdev] O3 passes
Can I specify passes that I want run directly to llvm-gcc? I don't want
all of -O3, for example. I tried llvm-gcc -raiseallocs ..., but that
didn't work. I also tried running cc1 directly and it didn't take
-raiseallocs as a parameter either.
Duncan Sands wrote:
> On Tuesday 28 April 2009 04:02:47 am Ryan M. Lefever wrote:
>> I assume that when -O3 (or O2 or O1) is
2006 Dec 04
0
[LLVMdev] problem using scc_iterator on CallGraph
On Sun, 3 Dec 2006, Ryan M. Lefever wrote:
> I am working on a transform that uses an scc_iterator on a program's
> CallGraph. However, I am running into a problem in which not all
> callees are being processed before callers, leading me to believe there
> might be a bug. In particular, this is happening in a case where a
> callee is a function pointer. I ran bugpoint and
2007 Feb 24
3
[LLVMdev] cast instruction
I need to create a cast instruction that casts an sbyte* to another
pointer type. Previously I was using the CastInst::createInferredCast()
function to do that; however, that function has been removed. Which of
the create() functions from CastInst should I use to do that? It seems
like the obdvious answer should be createPointerCast(). However, the
documentation for createPointerCast
2006 May 01
2
[LLVMdev] printf decleration
I am writing a pass where I need to make a function deceleration for
printf. Below is the code I'm trying to use.
-----
bool MyPass::runOnModule(Module &m) {
vector<const Type*> args;
args.push_back(PointerType::get(Type::SByteTy));
Function* f = m.getOrInsertFunction("printf",
FunctionType::get(Type::IntTy, args, true));
-----
When I insert a call