similar to: [LLVMdev] type attributes

Displaying 20 results from an estimated 60000 matches similar to: "[LLVMdev] type attributes"

2008 Apr 09
0
[LLVMdev] type attributes
Hi Zach, > Does the bitcode representation retain any information about gcc attributes > placed on types? yes it does, at least for some of them. For example, suppose you specify that a type should be 16 byte aligned. This will not change the LLVM type, instead every time an object of your type is created the object creation operation (eg: an alloca) will ensure that the object is 16
2011 Aug 16
1
[LLVMdev] Missing metadata for volatile variables
Hi everyone, I am using the dragonegg plugin to produce bitcode for the following small C program: int main() { 1: int x = -5; 2: x = 6; 3: return 0; } The assignments on lines 1 and 2 are removed even when no optimization flags are specified. I tried making variable "x" volatile, which prevents the assignments from being removed, however I am no longer able to recover the original
2009 Mar 11
4
[LLVMdev] Bug in X86CompilationCallback_SSE
I don't know how to file a PR, but I have a patch (see below), that should work regardless of abi differences, since it relies on the compiler to do the though job. void X86CompilationCallback_SSE(void) { char * SAVEBUF= (char*) alloca(64+12); // alloca is 16byte aligned asm volatile ( "movl %%eax,(%0)\n" "movl %%edx,4(%0)\n" // Save EAX/EDX/ECX
2011 Jun 23
2
[LLVMdev] type promotion i16 -> i32
Hello, I'm developing a llvm backend. It seems that, if i16 is not a legal type (no register can hold i16 types in RegisterInfo.td and as a RegisterClass in SelLowering.cpp), i16 should be promoted to i32. Nonotheless, this simple program: int main(){ volatile short a; a= 3; return 0; } which is trasformed in this IR: define i32 @main() nounwind readnone { entry: %a = alloca i16,
2015 Jun 09
2
[LLVMdev] Constant folding inttoptr i32 0 to null pointer?
On Tue, Jun 9, 2015 at 12:32 PM, David Majnemer <david.majnemer at gmail.com> wrote: > 'load volatile i32 addrspace(1)* null' seems fine to me. However, it > looks like instcombine will turn: > define i32 @foo() { > entry: > %std_ld.i = load volatile i32, i32 addrspace(1)* null > ret i32 %std_ld.i > } > > into: > define i32 @foo() { > entry:
2016 Nov 25
2
Translation of custom attribute (defined for variables) from clang to llvm
Hi All, I need your guidance about a custom attribute. I have defined one for variables. It is accepted in the source code (without any warnings from clang), for example in following snippet. #define NEWATTR __attribute__((moviAttr(1))) int main() { NEWATTR volatile unsigned int a = 5; volatile unsigned int *p; p = &a; return (a+*p); } and actually when I Dump the declaration, after
2011 Dec 16
4
[LLVMdev] load widening conflicts with AddressSanitizer
On Dec 16, 2011, at 12:39 PM, Kostya Serebryany wrote: > > Do we consider the above transformation legal? Yes, the transformation is perfectly legal for the normal compiler. > > I would argue that it should not be legal. We don't actually know what > > comes after the 22 byte object. Is it another memory object? A > > memory-mapped I/O device? Unmapped memory?
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:
2016 Nov 25
3
Translation of custom attribute (defined for variables) from clang to llvm
Hi Asit, thanks for the reply. But I guess I was not clear in my question. Actually, i dont want to use __ATTRIBUTE__((ANNOTATE("MOVIATTR"))), since in documentation it is stated that "This intrinsic allows annotation of local variables with arbitrary strings. This can be useful for special purpose optimizations that want to look for these annotations. These have no other
2012 Dec 09
3
[LLVMdev] ARM assembly
Hi All, I am working to cross compile (just generate assembly code) a simple C code in ARM. First, I use CLANG to get LLVM bytecode, then I use llc to generate assembly for ARM. The problem is it never uses any other register except r0-r3 and always uses spill code even if other register are available to use. Anyone has any idea? Thanks Best Regards, A. Yazdanbakhsh
2007 Dec 13
4
[LLVMdev] Obfuscation Transformations Clobbered by Unkown Optimizations
Hello all, I am implementing some simple obfuscation transformations in LLVM. One of the obfuscations involves searching for particular constants, and "unrolling" them throughout a procedure using arithmetic. In effect, certain constants are broken up into smaller constants and recombined as needed using the appropriate operators. I perform this on intermediate LLVM instructions. After
2007 Dec 14
0
[LLVMdev] Obfuscation Transformations Clobbered by Unkown Optimizations
On Thu, 13 Dec 2007, Matt Fredrikson wrote: > After I run opt on an un-obfuscated bitcode file to produce an > obfuscated bitcode file, I verify that my transformations were placed ok > in the file using llvm-dis. At this point, the changes appear to have > been made. However, if I run the obfuscated bitcode file through llc > to produce x86 assembly, the obfuscations vanish. I
2009 Mar 11
0
[LLVMdev] Bug in X86CompilationCallback_SSE
Hello, Corrado > Before you can correctly invoke a function via the Procedure Linkage > Table (plt), the ABI mandates that ebx is pointing to the GOT (Global > Offset Table) (see http://www.greyhat.ch/lab/downloads/pic.html) This is known issue, just nobody realized, that we have bunch of non- PIC-aware assembler code. :) Fixing would be not so trivial though, mostly due to ABI
2015 Apr 03
3
[LLVMdev] why are volatile memory accesses ordered?
Marking volatile accesses as !unordered seems excessively conservative. For instance, LLVM is not able to optimize declare void @escape(i32*) declare i32 @read_only(i32) readonly define i32 @f(i1* %c) { entry: %a = alloca i32 %b = alloca i32 call void @escape(i32* %a) call void @escape(i32* %b) %a0 = load i32, i32* %b, align 4 %lv = load volatile i32, i32* %b %a1 = load i32,
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
2015 Jun 09
4
[LLVMdev] Constant folding inttoptr i32 0 to null pointer?
Thanks David, It turns out, that the address space I was using was not 0, and yet the pointer was constant folded to null. Here is the sequence: Unoptimized code: define i32 @foo() #0 { entry: %address.addr.i = alloca i32, align 4 %value.i = alloca i32, align 4 store i32 0, i32* %address.addr.i, align 4 %0 = load i32* %address.addr.i, align 4 %1 = inttoptr i32 %0 to i32 addrspace(1)*
2013 Nov 03
3
[LLVMdev] freeing alloca'd variables before function exits
Hi, In my llvm code I want to create some function calls. The function prototype is as follows: int memoize ( char *function_name, int *int_params, unsigned num_ints, double *double_params, unsigned num_doubles) In order to create these calls I do the following for example: %88 = alloca [7 x i8] store volatile [7 x i8] c"ORACLE\00", [7 x i8]*
2013 Jan 18
2
[LLVMdev] Weird volatile propagation ?
Hi All, Using clang+llvm at head, I noticed a weird behaviour with the following reduced testcase : $ cat test.c #include <stdint.h> struct R { uint16_t a; uint16_t b; }; volatile struct R * const addr = (volatile struct R *) 416; void test(uint16_t a) { struct R r = { a, 1 }; *addr = r; } $ clang -O2 -o - -emit-llvm -S -c test.c ; ModuleID = 'test.c' target
2015 Apr 03
2
[LLVMdev] why are volatile memory accesses ordered?
Dunno whether it's worthwhile, but we definitely test for it, and if his two non-volatile loads were identical, we'd definitely eliminate them in GVN. On Thu, Apr 2, 2015 at 6:09 PM, Chandler Carruth <chandlerc at google.com> wrote: > Could you explain why you think it is worthwhile to optimize code involving > a volatile access? > > On Thu, Apr 2, 2015 at 6:08 PM
2007 Apr 18
1
[PATCH 4/14] i386 / Clean up asm and volatile keywords in desc
Stop using extra underscores on asm and volatiles, that is just silly. Also, make lgdt/lidt/sgdt/sldt explicitly "l". Patch-base: 2.6.13-rc5-mm1 Patch-keys: i386 desc cleanup Signed-off-by: Zachary Amsden <zach@vmware.com> Index: linux-2.6.13/include/asm-i386/mach-default/mach_desc.h =================================================================== ---