Displaying 20 results from an estimated 4000 matches similar to: "Function arguments pass by value or by reference."
2020 Jun 13
2
target-features attribute prevents inlining?
Hello,
I'm new to LLVM and I recently hit a weird problem about inlining behavior.
I managed to get a minimal repro and the symptom of the issue, but I
couldn't understand the root cause or how I should properly handle this
issue.
Below is an IR code consisting of two functions '_Z2fnP10TestStructi' and
'testfn', with the latter calling the former. One would expect the
2020 Jun 13
2
target-features attribute prevents inlining?
Hi David,
Thanks for your quick response!
I now understand the reason that inlining cannot be done on functions with
different target-attributes. Thanks for your explanation!
However, I think I didn't fully understand your solution; it would be nice
if you would like to elaborate a bit more. Here's a bit more info on my
current workflow:
(1) The clang++ compiler builds C++ source file
2020 Jun 13
2
target-features attribute prevents inlining?
Thank you so much David! After thinking a bit more I agree with you that
attempting to add 'target-features' to my functions seem to be the safest
approach of all.
I noticed that if I mark the clang++ function as 'AlwaysInline', the
inlining is performed normally. Is this a potential bug, given what you
said that LLVM may accidentally move code using advanced cpu features
outside
2009 Apr 07
3
[LLVMdev] Patch: MSIL backend global pointers initialization
Hello Anton
> %1 = tail call i32 (i8*, ...)* @printf(i8* noalias getelementptr ([16 x
> > i8]* @.str, i32 0, i32 0), i32 %0) nounwind
> > %10 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr ([11 x i8]*
> > @.str2, i32 0, i32 0), i32 5) nounwind
> >
> > Instruction::isSameOperationAs() returns false for those two. Is it a
> > bug or I misunderstood
2008 Sep 13
3
[LLVMdev] Duplicate Function with duplicated Arguments
I'm now writing a pass and I wanna ask a question about how to
duplicate the function and add duplicated arguments in llvm, for
example:
func(int a, char *b) -> func(int a, char *b, int a1, char *b1)
I'm now stuck at using "getOrInsertFunction" and how to handle
"getArgumentList", please share your opinion, thanks a lot!
James
2009 Apr 07
0
[LLVMdev] Patch: MSIL backend global pointers initialization
Artur,
> OK, I just need the same signature for both of those instructions.
Both are callinsts of same function, isn't that enough? Since it's a
variadic function there is also a bitcast to proper type. So, looking
for type of callee (not result, but function type!) you'll obtain the
real "signature" of callee and if you'll strip all pointer cast you'll
obtain the
2006 May 17
3
Providers using Embedded Devices
Just curious...
Does anyone know if any companies using Asterisk on embedded hardware (out at the customer premisis), such as the Soekris Net4801, to provide VOIP service?
Doug.
2015 Jul 29
1
[LLVMdev] How to get the const argument data from Function?
Hi,
I am doing a project involving checking a called specific function’s
argument. Suppose that the function is int f(const char* str).
When I am analyzing such a snippet:
f("hello")
, then compiled by Clang, I will have the “hello” as a *Constant Array* in
the IR code. My goal is to call APIs of LLVM to get the “hello” from IR
code.
Now suppose the I got the llvm::Function* fn from
2014 Sep 09
5
[LLVMdev] [RFC] Attributes on Values
Hi everyone,
Nick and Philip suggested something yesterday that I'd also thought about: supporting attributes on values (http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140908/234323.html). The primary motivation for this is to provide a way of attaching pointer information, such as noalias, nonnull and dereferenceable(n), to pointers generated by loads. Doing this for pointers
2019 Dec 18
5
RFC: Opaque pointer status and future direction
Hi all,
At the dev meeting I promised to update everyone on where my work with opaque
pointers is right now. It's taken me a while, but at least it's the same year!
Current Status
==============
I've put two branches up at https://github.com/TNorthover/llvm-project:
"opaque-ptr" which has most of the real work so far; and "opaque-ptr-always"
that additionally has
2016 Jan 19
8
[RFC] A proposal for byval in a world with opaque pointers
Hi,
In the past months, several options have been presented for making byval
(and similar attributes, such as inalloca or sret) work with opaque pointers.
The main two I've seen were byval(T) and byval(N) where N is the size of T.
They both have their upsides and downsides, for example: byval(T) would be
a type-parametric attribute, which, AFAIK, does not already exist and may
complicate
2016 Jan 19
2
[RFC] A proposal for byval in a world with opaque pointers
> Do all tests need it? Align is just for non-default alignment (> align(1)) so it may be OK for the tests to omit it & it's probably not right to /require/ an align attribute on a byval parameter.
I've had to fix some of the tests which checked that the right
alignment was applied,
by looking at the generated asm, but had no "align A" attributes and
relied on the
2012 Nov 01
2
[LLVMdev] llvm linking issue
I have three modules:
-----------------------------------------------------------------
s1.ll:
%0 = type <{ i32, i32 }>
define void @s1(%0* byval %myStruct) nounwind {
return:
ret void
}
-----------------------------------------------------------------
s2.ll:
%0 = type <{ i32, i32 }>
define void @s2(%0* byval %myStruct) nounwind {
return:
ret void
}
2011 May 11
3
[LLVMdev] Header in bitcode format 3.0?
On May 9, 2011, at 1:41 PM, Renato Golin wrote:
[snip]
> One example is the struct byval. The ARM back-end still doesn't
> support struct byval (maybe now it does, I was away for a while),
The ARM backend now supports struct byval for APCS. Extending it to support AAPCS shouldn't be too difficult. Alas, I won't have time to revisit this in the near future.
stuart
2013 Jul 05
4
[LLVMdev] making a copy of a byval aggregate on the callee's frame
Hi Tim,
Thought about it last night and was coming to the same conclusion.
1. it cant be done at the end during lowering (target backend).
2. it should be part of llvm as the byVal needs to be handled.
As a twist, I have been told that llvm-gcc can lower byVal into memcpy in the callee.
I may take a look at this.
I wonder if it ever emits 'byVal'...
I still feel I don't understand
2011 May 12
0
[LLVMdev] Header in bitcode format 3.0?
On Wed, May 11, 2011 at 11:42 PM, Stuart Hastings <stuart at apple.com> wrote:
>
> On May 9, 2011, at 1:41 PM, Renato Golin wrote:
>
> [snip]
>
>> One example is the struct byval. The ARM back-end still doesn't
>> support struct byval (maybe now it does, I was away for a while),
>
> The ARM backend now supports struct byval for APCS. Extending it to
2012 May 12
2
[LLVMdev] Info on byval attributes
LLVM developers,
I was wondering if the program would still be safe if I strip the
byval attributes from the parameters in the entire bitcode.
LLVM language reference manual states that "The attribute implies that
a hidden copy of the pointee is made between the caller and the
callee, so the callee is unable to modify the value in the callee.
This attribute is only valid on LLVM pointer
2018 Sep 25
2
byval argument causes llvm to crash after inlining
It is problematic when byval argument is not from address space 0. When the default alloca address space is 0, should we consider this IR illegal?
define internal i32 @bar(i32 addrspace(1)* byval %a) alwaysinline
From: Reid Kleckner [mailto:rnk at google.com]
Sent: Tuesday, September 25, 2018 2:38 PM
To: Pan, Wei <wei.pan at intel.com>
Cc: llvm-dev <llvm-dev at lists.llvm.org>
2012 Nov 01
0
[LLVMdev] llvm linking issue
Hi Xiaoyi, this looks like a bug to me - please file a bug report.
Ciao, Duncan.
On 01/11/12 04:35, Guo, Xiaoyi wrote:
> I have three modules:
> -----------------------------------------------------------------
> s1.ll:
>
> %0 = type <{ i32, i32 }>
>
> define void @s1(%0* byval %myStruct) nounwind {
> return:
> ret void
> }
>
2018 Sep 25
2
byval argument causes llvm to crash after inlining
This sounds right to me. If there is no objection, I will implement a patch to enforce this in langref and IR verifier.
-----Original Message-----
From: Friedman, Eli [mailto:efriedma at codeaurora.org]
Sent: Tuesday, September 25, 2018 3:07 PM
To: Pan, Wei <wei.pan at intel.com>; Reid Kleckner <rnk at google.com>
Cc: llvm-dev <llvm-dev at lists.llvm.org>
Subject: Re: