Displaying 20 results from an estimated 100000 matches similar to: "[LLVMdev] Finding the value of variables"
2012 Jul 31
0
[LLVMdev] [DragonEgg] Mysterious FRAME coming from gimple to LLVM
According to comment in tree-nested.c, these frames should be only
introduced in case of debug or OpenMP lowering:
/* A subroutine of convert_nonlocal_reference_op. Create a local variable
in the nested function with DECL_VALUE_EXPR set to reference the true
variable in the parent function. This is used both for debug info
and in OpenMP lowering. */
However, in this code example we
2012 Jul 31
3
[LLVMdev] [DragonEgg] Mysterious FRAME coming from gimple to LLVM
Hi Duncan,
A DragonEgg/GCC-related question: do you know where these strange FRAME
tokens originate from (e.g. %struct.FRAME.matmul)? Compiling simple Fortran
code with DragonEgg:
> cat matmul.f90
subroutine matmul(nx, ny, nz)
implicit none
integer :: nx, ny, nz
real, dimension(nx, ny) :: A
real, dimension(ny, nz) :: B
real, dimension(nx, nz) :: C
integer :: i, j, k
real,
2013 Oct 28
0
[LLVMdev] loop vectorizer says Bad stride
Frank,
It looks like the loop vectorizer is unable to tell that the two stores in your code never overlap. This is probably because of the sign-extend in your code. Can you extend the indices to 64bit ?
Thanks,
Nadav
On Oct 28, 2013, at 1:38 PM, Frank Winter <fwinter at jlab.org> wrote:
> Verifying function
> running passes ...
> LV: Checking a loop in "bar"
> LV:
2013 Nov 12
0
[LLVMdev] What's the Alias Analysis does clang use ?
Hi,
Your problem is that the function arguments, which are makes as noalias, are not being directly used as the base objects of the array accesses:
> %v0.addr = alloca float*, align 8
> %v1.addr = alloca float*, align 8
> %v2.addr = alloca float*, align 8
> %t.addr = alloca float*, align 8
...
> store float* %v0, float** %v0.addr, align 8
> store float* %v1, float** %v1.addr,
2013 Oct 28
2
[LLVMdev] loop vectorizer says Bad stride
Verifying function
running passes ...
LV: Checking a loop in "bar"
LV: Found a loop: L0
LV: Found an induction variable.
LV: We need to do 0 pointer comparisons.
LV: Checking memory dependencies
LV: Bad stride - Not an AddRecExpr pointer %13 = getelementptr float*
%arg2, i32 %1 SCEV: ((4 * (sext i32 {(256 + %arg0),+,1}<nw><%L0> to
i64)) + %arg2)
LV: Src Scev: {((4 * (sext
2013 Dec 17
2
[LLVMdev] Add call printf instructions problems
Thanks,Cheers!
I found the problem is that the "Function *call_print" using the same name
as the “class call_print”, which made the compiler wrongly resolved the
call_print type!
But I got another problems. I successfully compile the pass and I can
insert the call printf (C Lib function) instructions in the LLVM IR(eg:
call.bc). If the call.bc didn't contain call printf
2008 Jul 18
1
[LLVMdev] Alignment of vectors
Hi,
Comments inline.
Ben
On 18/07/2008 16:30, "Eli Friedman" <eli.friedman at gmail.com> wrote:
> On Fri, Jul 18, 2008 at 6:45 AM, Benedict Gaster
> <benedict.gaster at amd.com> wrote:
>> Consider the following C code:
>>
>> typedef __attribute__(( ext_vector_type(2) )) float float2;
>> typedef __attribute__(( ext_vector_type(2) ))
2011 Aug 11
2
[LLVMdev] Pass a struct on windows
Hi,
I made a simple test about aggregates in llvm IR. My simple LLVM code
is running as expected under linux 32/64, but not under windows 32.
After searched on the web on multiple return values, I'm still not sure if
this test case can be flagged as the ABI issue. Or this would be a llvm
code generator bug on window 32. The complete IR is attached as a text file
and I checked the test with
2008 Jul 18
0
[LLVMdev] Alignment of vectors
On Fri, Jul 18, 2008 at 6:45 AM, Benedict Gaster
<benedict.gaster at amd.com> wrote:
> Consider the following C code:
>
> typedef __attribute__(( ext_vector_type(2) )) float float2;
> typedef __attribute__(( ext_vector_type(2) )) __attribute__(( aligned(4) ))
AFAIK, the aligned attribute doesn't do anything on a typedef of
anything other than a struct/union type in either
2017 Jun 19
2
LLVM behavior different depending on function symbol name
using `opt --print-after-all -O3` I see that EarlyCSE is interpreting the
call to `ceil` and constant fold:
*** IR Dump After Early CSE ***
; Function Attrs: nobuiltin nounwind
define i1 @do_test() #2 {
Entry:
%0 = call fastcc float @ceil(float 0.000000e+00) #6
%1 = call fastcc float @ceil32(float 0.000000e+00) #6
%2 = fcmp fast oeq float 0.000000e+00, %1
ret i1 %2
}
So just running `opt
2013 Nov 11
2
[LLVMdev] What's the Alias Analysis does clang use ?
Hi, LLVM community:
I found basicaa seems not to tell must-not-alias for __restrict__ arguments
in c/c++. It only compares two pointers and the underlying objects they
point to. I wonder how clang does alias analysis
for c/c++ keyword restrict.
let assume we compile the following code:
$cat myalias.cc
float foo(float * __restrict__ v0, float * __restrict__ v1, float *
__restrict__ v2, float *
2008 Jul 18
2
[LLVMdev] Alignment of vectors
Consider the following C code:
typedef __attribute__(( ext_vector_type(2) )) float float2;
typedef __attribute__(( ext_vector_type(2) )) __attribute__(( aligned(4) ))
float float2_align2;
void foo(void)
{
const float * p;
size_t offset;
float2 tmp = *((float2_align2 *)(p+offset));
}
When compiled with clang emit-llvm I get:
define void @foo() {
entry:
%p = alloca float*, align 4
2016 Jul 31
0
IR @llvm.dbg.value entries for variables when a phi node has been created
+Adrian Prantl <aprantl at apple.com> who might have some ideas about the
representation choices/current/future behavior here
On Fri, Jul 29, 2016 at 12:27 PM Keith Walker via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> I have been investigating missing variables / incorrect variable values
> when debugging code compiled at –O1 (and above) and believe that I have
>
2011 Apr 26
2
[LLVMdev] confused about float literals
I assumed that C floats are 32 bits and doubles 64 bits ... but
This code
int main(){
float f;
double f1;
f = 3.145;
f1 = 3.145;
return(0);
}
Compiles (via clang) to:
; ModuleID = 'test101.c'
target datalayout =
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
target triple =
2014 Nov 03
8
[LLVMdev] [PATCH] Protection against stack-based memory corruption errors using SafeStack
Dear LLVM developers,
Our team has developed an LLVM-based protection mechanism that (i) prevents
control-flow hijack attacks enabled by memory corruption errors and (ii)
has very low performance overhead. We would like to contribute the
implementation to LLVM. We presented this work at the OSDI 2014 conference,
at several software companies, and several US universities. We received
positive
2013 Nov 08
1
[LLVMdev] loop vectorizer and storing to uniform addresses
I changed the input C to using a 64 bit type for the loop index (this
eliminates 'sext' instructions in the IR)
Here the IR produced with clang -O0
define float @foo(i64 %start, i64 %end, float* %A) #0 {
entry:
%start.addr = alloca i64, align 8
%end.addr = alloca i64, align 8
%A.addr = alloca float*, align 8
%sum = alloca [4 x float], align 16
%i = alloca i64, align 8
2016 Nov 28
2
Translation of custom attribute (defined for variables) from clang to llvm
Hi John,
I have looked into the EmitAutoVarAlloca() in CGDecl.cpp. However, I
could not figure out how to employ my custom attribute for code
generation. For example, my custom attribute is visible in CGDecl.cpp
but how can I generate based on my custom attribute
if (D.hasAttr<myCustomAttri>())
{
//What to do here?
}
What I wan in IR is something like below.
Without Custom Attribute:
2011 Aug 11
0
[LLVMdev] Pass a struct on windows
Hi Wei, this is a FAQ. The LLVM code generators do *not* try to produce ABI
conformant code. Instead, your front-end must produce LLVM IR which is already
ABI conformant. For example, on a platform where a function returning a struct
should return it via a hidden pointer, the IR function should be declared with
an explicit pointer argument for returning it; while on platforms for which it
2011 Aug 11
1
[LLVMdev] Pass a struct on windows
Thanks for reply! This is indeed annoying. I suspect that passing an pointer
to the struct
and using GEP instructions to access and modify the struct would work on all
platforms.
Is this true?
Thanks,
Wei
On Thu, Aug 11, 2011 at 7:55 AM, Duncan Sands <baldrick at free.fr> wrote:
> Hi Wei, this is a FAQ. The LLVM code generators do *not* try to produce
> ABI
> conformant code.
2014 Jan 14
2
[LLVMdev] Question About the LLVM IR unnamed values!
Hi.
I found that, in all the LLVM IR I get from the source C file. the unnamed
values all created by the "load" instruction. eg:
; Function Attrs: nounwind uwtable
define i32 @add(i32 %x, i32 %y) #0 {
entry:
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
%c = alloca i32, align 4
store i32 %x, i32* %x.addr, align 4
store i32 %y, i32* %y.addr, align 4
* %0 =