Displaying 20 results from an estimated 30000 matches similar to: "[LLVMdev] Query on optimizing away function calls."
2009 Jun 18
2
[LLVMdev] Query on optimizing away function calls.
Hi all.
Consider the following code:
------------
define void @func() {
%a = alloca i32
store i32 42, i32* %a
call void @func2(i32* %a) nounwind
ret void
}
define void @func2(i32* %a) nounwind {
store i32 43, i32* %a
ret void
}
------------
It is possible to optimize this to:
------------
define void @func() {
ret void
}
define void @func2(i32* %a) nounwind {
2009 Jun 18
0
[LLVMdev] Query on optimizing away function calls.
Hi,
> Consider the following code:
>
> ------------
> define void @func() {
> %a = alloca i32
> store i32 42, i32* %a
> call void @func2(i32* %a) nounwind
> ret void
> }
>
> define void @func2(i32* %a) nounwind {
> store i32 43, i32* %a
> ret void
> }
> ------------
>
> It is possible to optimize this to:
>
>
2015 Apr 19
2
[LLVMdev] LLVM IR for inline functions
Hi,
I have a naive question on how to generate LLVM IR for inline functions. I
have compiled this C code:
*inline void func1()*
* {*
* int x=3;*
* }*
* void func2()*
* {*
* func1();*
* int y = 4;*
* }*
into LLVM IR, using
clang -emit-llvm -S -c <filename>
But the generated LLVM IR file does *not* have func1() expanded (see below
for the relevant parts).
*; Function Attrs: nounwind
2010 Jun 16
3
[LLVMdev] Strange pointer aliasing behaviour
I'm hitting a strange pointer aliasing "bug". Here is a test case :
/* SOURCE CODE */
#define little_list_size 8
class LittleList1 {
public:
int _length;
double _data[ little_list_size ];
LittleList1( int length )
{
_length = length;
for( int i=0; i<length; i++ )
_data[i] = 0;
}
};
class LittleList2 {
public:
int _length;
double _data[ little_list_size ];
2010 Jun 17
0
[LLVMdev] Strange pointer aliasing behaviour
On Wed, Jun 16, 2010 at 1:39 PM, Pierre C <lists at peufeu.com> wrote:
>
> I'm hitting a strange pointer aliasing "bug". Here is a test case :
>
> /* SOURCE CODE */
>
> #define little_list_size 8
>
> class LittleList1 {
> public:
> int _length;
> double _data[ little_list_size ];
>
> LittleList1( int length )
>
2013 Oct 29
1
[LLVMdev] JIT'ing 2 functions with inter-dependencies
I am having problems JIT'ing 2 functions where one of them calls the
other. (I am using the old JIT interface).
Here is the setup:
define void @func1() {
entrypoint:
call void @func2(void)
ret void
}
define void @func2(void) {
entrypoint:
ret void
}
(I omit the arguments and function bodies for simplicity.)
It's 'func1' that would be called from host code,
2011 Sep 06
2
Generalizing call to function
Hello guys,
I would like to ask for help to understand what is going on in
"func2". My plan is to generalize "func1", so that are expected same
results in "func2" as in "func1". Executing "func1" returns...
0.25 with absolute error < 8.4e-05
But for "func2" I get...
Error in dpois(1, 0.1, 23.3065168689948, 0.000429064542600244,
2009 Sep 14
1
[LLVMdev] How to split module?
Hi, all.
My question is about how to split one module into N modules(N >= 2)?
For example, given the following code:
#src.c#
int main()
{
//......//
func1();
func2();
//......//
return 0;
}
void func1()
{
//......//
}
void func2()
{
//......//
}
func1() has no dependence with func2(), so they can perform parallel
execution. And I have to split src.c into src1.c
2003 Jun 09
1
Questions for package ts prediction
Dear helpers,
I am trying to write a function to return prediction values using
package ts. I have written three different versions since I am not sure
what's wrong with my func2. func and func1 return the same results.But
func1 and func2 don't. In particular, the only difference between
"func1" and "func2" is the function variable name being y and data,
respectively.
2010 Dec 01
10
[LLVMdev] RFC: Exception Handling Proposal Revised
This is a revision of the second exception handling proposal I sent out. You can see it here:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2010-November/036484.html
After much discussion, there are some changes to the proposal – some significant and some minor. One major point, this proposal does not address the issue of catching an exception thrown from a non-invoke instruction. However if done
2000 Sep 06
2
reusing external functions across libs
Hi,
I am searching for a way to solve the following problem:
I want to use an external function, defined in a dyn.load()ed shared
object, in another dyn.load()ed shared object.
Currently I have to take the sources (Fortran) from one libraries src/
directory and copy them into the src/ dir of the other library, resulting
in two copies of this function. This is bad for maintanance and maybe
also
2011 Nov 30
0
[LLVMdev] -Wunreachable-code and templates
I'm just wondering if anyone's already working on addressing the
current shortcomings around -Wunreachable-code in regards to
templates.
Take the following simple example:
$ cat unreachable.cpp
int func1();
int func2();
template<bool b>
int func() {
return !b ? func1() : func2();
}
int main() {
return func<true>() + func<false>();
}
$ clang++ -Wunreachable-code
2011 Feb 17
1
Integration with an Indicator Function in R
Hi all,
I have some some problem with regard to finding the integral of a
function containing an indicator function.
please see the code below:
func1 <- function(x, mu){
(mu^2)*dnorm(x, mean = mu, sd = 1)*dgamma(x, shape=2)}
m1star <- function(x){
integrate(func1, lower = 0, upper = Inf,x)$val}
T <- function(x){
0.3*dnorm(x)/(0.3*dnorm(x)+0.7*m1star(x))}
func2 <-
2011 Feb 17
1
Integrate with an indicator function
Hi all,
I have some some problem with regard to finding the integral of a
function containing an indicator function.
please see the code below:
func1 <- function(x, mu){
(mu^2)*dnorm(x, mean = mu, sd = 1)*dgamma(x, shape=2)}
m1star <- function(x){
integrate(func1, lower = 0, upper = Inf,x)$val}
T <- function(x){
0.3*dnorm(x)/(0.3*dnorm(x)+0.7*m1star(x))}
func2 <-
2012 Mar 19
5
[LLVMdev] recognizing DTORs and vptr updates in LLVM.
Hello,
While instrumenting LLVM IR in ThreadSanitizer (race detector), I need
to distinguish between a store to vtable pointer (vptr) and any other
regular store.
This special treatment should be limited to class DTORs, so I should also
know when a function is a DTOR.
Rationale: need to distinguish benign and harmful races on vptr (
2012 Mar 19
0
[LLVMdev] recognizing DTORs and vptr updates in LLVM.
On Mar 19, 2012, at 2:52 PM, Kostya Serebryany wrote:
> Hello,
>
> While instrumenting LLVM IR in ThreadSanitizer (race detector), I need to distinguish between a store to vtable pointer (vptr) and any other regular store.
> This special treatment should be limited to class DTORs, so I should also know when a function is a DTOR.
> Rationale: need to distinguish benign and
2003 Feb 03
0
extension of generic functions in methods package
How can I extend the signature of a generic function, because the following
example is unclear for me.
setClass("A",representation(data="numeric"));
setGeneric("func",function(obj,...){
res <- standardGeneric("func");
res at cal <- match.arg();
return(res);
});
func1.A <- function(obj){
print("A");
return();
}
2007 Jun 01
2
Getting names of objects passed with "..."
Is there a tidy way to get the names of objects passed to a function via the
"..." argument?
rbind/cbind does what I want:
test.func1 <- function(...) {
nms <- rownames(rbind(..., deparse.level=1))
print(nms)
}
x <- "some stuff"
second <- "more stuff"
test.func1(first=x, second)
[1] "first" "second"
The usual
2009 Mar 30
1
[LLVMdev] Determining the base offset of the stack for a function.
I am running into an issue where if I have multiple functions compiled
in the same compilation unit the stack offset is not starting at zero.
For example:
func1(...)
{
...
}
func2(...)
{
...
}
Say the first function uses 64 bytes of the stack and an assumed offset
of 0 and the second function uses 32 bytes of the stack but an assumed
offset of 64. I've found out how to get the
2011 Jan 20
0
Writing functions. please help
Hi, my name is Guilherme and I'm trying to solve an optimization problem in
R, regarding reliability and survival time of equipments. I Have to write
the function in the image attached to this email, please take a look, where
the f(t) is weibull's distribution density function, Ca=1000 and Cb=100 are
costs of two equipments and i'm using shape=2.5 and scale=20. However, a few
problems