search for: i8

Displaying 20 results from an estimated 3951 matches for "i8".

2008 Jan 06
4
[LLVMdev] Another memory fun
hm.... I think, that is valid in c but next code too doesn't works right: ; ModuleID = 'sample.lz' @.str1 = internal global [6 x i8] c"world\00" ; <[6 x i8]*> [#uses=1] @.str2 = internal global [7 x i8] c"hello \00" ; <[7 x i8]*> [#uses=1] @.str7 = internal global [7 x i8] c"father\00" ; <[7 x i8]*> [#uses=1] @.str8 = internal global [8 x i8] c"mot...
2011 Feb 15
3
[LLVMdev] How to use ConstantFoldConstantExpression?
...e to make it fold anything. Could you please give me some advice, what I am doing wrong? My code looks something like this: //data layout is obtained from clang-generated code for triple arm-none-linux-gnueabi with added v32:32:32 const char* const TARGET_DATA_LAYOUT = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v128:128:128-a0:0:64-n32"; TargetData TD(TARGET_DATA_LAYOUT); void transformConstantExpr(ConstantExpr* cop) { Constant* val = ConstantFoldConstantExpression(cop, &TD); if (val != NULL) { errs() <<...
2012 Jan 19
4
[LLVMdev] What happened to "malloc" in LLVM 3.0 IR?
...dent that produces .ll files, It behaved fine at the time. Trying to take the work over using version 3.0, I run into the problem that "malloc" in the IR is no longer valid: semac1 menu > llvm-as Carre.ll llvm-as: Carre.ll:68:14: error: expected instruction opcode %_malloc = malloc i8, i32 %2 ; <i8*> [#uses=1] ^ Couldn't find any hint on the web about how to modify the code generation in this compiler to go ahead. Thanks for your help! Regards, -- Faulty line above is part of the following function: define i8* @lista_sprintf_double...
2008 Jan 06
4
[LLVMdev] Another memory fun
Hey again) Now I have next code: ; ModuleID = 'sample.lz' @.str1 = internal global [8 x i8] c" world!\00" ; <[8 x i8]*> [#uses=1] @.str2 = internal global [8 x i8] c"hello, \00" ; <[8 x i8]*> [#uses=1] @.str7 = internal global [21 x i8] c"welcome to out hall!\00" ; <[21 x i8]*> [#uses=1] declare i32 @puts(i8*) de...
2011 Feb 15
0
[LLVMdev] How to use ConstantFoldConstantExpression?
...d you please give me some advice, what I am doing wrong? > > > My code looks something like this: > > //data layout is obtained from clang-generated code for triple arm-none-linux-gnueabi with added v32:32:32 > const char* const TARGET_DATA_LAYOUT = > "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v128:128:128-a0:0:64-n32"; > > TargetData TD(TARGET_DATA_LAYOUT); > > void transformConstantExpr(ConstantExpr* cop) > { > Constant* val = ConstantFoldConstantExpression(cop, &TD); > if (val...
2009 Feb 22
3
[LLVMdev] Broke my tail (call)
I have written a variety tests of tail calls for my HLVM and all passed with flying colors until I wrote this test (which is actually for algebraic datatypes) and discovered that it segfaults after ~100k iterations through what I think should be a tail call. Here's the IR: define fastcc { { i8*, i8* }*, i8* } @init({ { i8*, i8* }*, i8* }, i32) { entry: %2 = alloca { i32, { { i8*, i8* }*, i8* } } ; <{ i32, { { i8 *, i8* }*, i8* } }*> [#uses=3] %3 = alloca { { i8*, i8* }*, i8* } ; <{ { i8*, i8* }*, i8* }*> [#uses=3] br label %s...
2012 Jan 19
0
[LLVMdev] What happened to "malloc" in LLVM 3.0 IR?
...It behaved fine at the time. > > Trying to take the work over using version 3.0, I run into the problem that "malloc" in the IR is no longer valid: > > semac1 menu> llvm-as Carre.ll > llvm-as: Carre.ll:68:14: error: expected instruction opcode > %_malloc = malloc i8, i32 %2 ;<i8*> [#uses=1] > ^ > > Couldn't find any hint on the web about how to modify the code generation in this compiler to go ahead. the malloc instruction was removed because it no longer offered any advantages over recognizing the standard...
2008 Jan 06
0
[LLVMdev] Another memory fun
...write out the correct code in C and then use llvm-gcc (or the demo page at http://llvm.org/demo ) to see what it looks like in LLVM assembly. Nick Zalunin Pavel wrote: > Hey again) > > Now I have next code: > > ; ModuleID = 'sample.lz' > @.str1 = internal global [8 x i8] c" world!\00" ; <[8 x i8]*> > [#uses=1] > @.str2 = internal global [8 x i8] c"hello, \00" ; <[8 x i8]*> > [#uses=1] > @.str7 = internal global [21 x i8] c"welcome to out hall!\00" > ; <[21 x i8]*> [#uses=1]...
2011 Feb 15
2
[LLVMdev] How to use ConstantFoldConstantExpression?
...d you please give me some advice, what I am doing wrong? > > > My code looks something like this: > > //data layout is obtained from clang-generated code for triple arm-none-linux-gnueabi with added v32:32:32 > const char* const TARGET_DATA_LAYOUT = > "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v128:128:128-a0:0:64-n32"; > > TargetData TD(TARGET_DATA_LAYOUT); > > void transformConstantExpr(ConstantExpr* cop) > { > Constant* val = ConstantFoldConstantExpression(cop, &TD); > if (val...
2008 Jan 06
0
[LLVMdev] Another memory fun
but why this code don't work: ; ModuleID = 'sample.lz' @.str1 = internal global [6 x i8] c"world\00" ; <[6 x i8]*> [#uses=1] @.str2 = internal global [7 x i8] c"hello \00" ; <[7 x i8]*> [#uses=1] @.str7 = internal global [7 x i8] c"father\00" ; <[7 x i8]*> [#uses=1] @.str8 = internal global [8 x i8] c"mot...
2015 May 03
2
[LLVMdev] Semantics of an Inbounds GetElementPtr
...I've got a question about what optimizations the "inbounds" keyword of "getelementptr" allows you to use. In the code below, %five is loaded from and inbounds offset of either a null pointer or %mem: target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128" define i8 @func(i8* %mem) { %test = icmp eq i8* %mem, null br i1 %test, label %done, label %mem.is.valid mem.is.valid: %1 = getelementptr inbounds i8, i8* %mem, i64 4 store i8 5, i8* %1, align 4 br label %done done: %after.phi = phi i8* [ %mem, %mem.is.valid ], [ null, %0 ] %2 = getelementptr i...
2008 Jan 06
4
[LLVMdev] Another memory fun
Yes, I agree with you -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080106/efb1c465/attachment.html>
2008 Jan 06
0
[LLVMdev] Another memory fun
...); > return 0; > } > This is valid C but you forget that str1 is not magically expanded by strcat. It starts out as, and remains a char array with 8 elements. > decompiler gives to me code, in this code string " mother\0" presents as: > > %str1 = > alloca [8 x i8], align 16 ; <[8 x i8]*> [#uses=9] > %tmp1 = getelementptr [8 x i8 > ]* %str1, i32 0, i32 0 ; <i8*> [#uses=2] > store i8 109, > i8* %tmp1, align 16 > %tmp4 = getelementptr [8 x i8]* %str1, i32 0, > i32 1 ; <i8*> [#uses=1] > store i8 111, i8* %tmp4, al...
2016 Jun 24
2
Strange opt result
...quot; opt --version LLVM (http://llvm.org/): LLVM version 3.8.0 DEBUG build with assertions. Built Jun 23 2016 (18:32:09). Default target: i686-pc-linux-gnu Host CPU: k8-sse3 " test.ll: " ; ModuleID = 'test.bc' @__mla__system.1 = global i32 0 @0 = internal global [12 x i8] zeroinitializer @1 = internal global [8 x i8] zeroinitializer @2 = internal constant [2 x i8] c"\0A\00" @3 = internal constant [3 x i8] c"%u\00" @4 = internal constant [5 x i8] c"%hhd\00" @5 = internal constant [4 x i8] c"%hd\00" @6 = internal constant [3 x...
2018 Jan 17
3
always allow canonicalizing to 8- and 16-bit ops?
Example: define i8 @narrow_add(i8 %x, i8 %y) { %x32 = zext i8 %x to i32 %y32 = zext i8 %y to i32 %add = add nsw i32 %x32, %y32 %tr = trunc i32 %add to i8 ret i8 %tr } With no data-layout or with an x86 target where 8-bit integer is in the data-layout, we reduce to: $ ./opt -instcombine narrowadd.ll -S def...
2011 Nov 02
1
[LLVMdev] [LLVMDev]: UNREACHABLE executed!
Hi, guys! I write a virtual machine which uses LLVM as back-end code generator. The following function code causes strange "UNREACHABLE executed!" error: define void @p1(%1*) { %2 = call i8* @llvm.stacksave() %3 = alloca %0 %4 = getelementptr %0* %3, i64 1 %5 = ptrtoint %0* %3 to i64 %6 = ptrtoint %0* %4 to i64 %7 = sub i64 %6, %5 %8 = bitcast %0* %3 to i8* call void @llvm.memset.p0i8.i64(i8* %8, i8 0, i64 %7, i32 0, i1 false) %9 = bitcast %1* %0 to [8 x i8]* %10 = b...
2009 Feb 23
0
[LLVMdev] Broke my tail (call)
...parameter. > > To me, also only glancing over the code and with a bit rusty llvm ir > knowledge, it seems that %14 (the value passed to the tail call)is > allocated in the stack frame (alloca) of the calling function. So the > above condition is violated. > > %3 = alloca { { i8*, i8* }*, i8* } > %13 = getelementptr { { i8*, i8* }*, i8* }* %3, i32 0 > %14 = load { { i8*, i8* }*, i8* }* %13 > %17 = tail call fastcc { { i8*, i8* }*, i8* } > @init({ { i8*, i8* }*,i8*} %14, i32 %16) I do not understand. Surely you should be testing for structs locally alloca...
2010 Jul 19
4
[LLVMdev] Is va_arg deprecated?
...#include<stdlib.h> void printValue(char * fmt, ...) { va_list args; va_start(args, fmt); int i; double d; i = va_arg(args, int); d = va_arg(args, double); va_end(args); } the generated llvm instructions: ; ModuleID = 'i.bc' 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 = "i386-pc-linux-gnu" define void @printValue(i8* %fmt, ...) nounwind { entry: %fmt_addr = alloca i8* ; <i8**> [#uses=1] %args.2...
2009 Feb 23
3
[LLVMdev] Broke my tail (call)
...>> > variable as a call parameter. To me, also only glancing over the code and with a bit rusty llvm ir knowledge, it seems that %14 (the value passed to the tail call)is allocated in the stack frame (alloca) of the calling function. So the above condition is violated. %3 = alloca { { i8*, i8* }*, i8* } %13 = getelementptr { { i8*, i8* }*, i8* }* %3, i32 0 %14 = load { { i8*, i8* }*, i8* }* %13 %17 = tail call fastcc { { i8*, i8* }*, i8* } @init({ { i8*, i8* }*,i8*} %14, i32 %16) >> Is this a bug in LLVM? > Could be, but first I'd like to be sure that you are not...
2009 May 12
1
[LLVMdev] How distinguish Catch all llvm-IR from other catch type ?
...ch_all.cpp: 1 int main() 2 { 3 try { 4 throw 34; 5 } 6 catch (...) {} 7 } llvm-gcc -O3 -S -emit-llvm catch_all.cpp -o catch_all.ll: 1 ; ModuleID = 'catch_all.cpp' 2 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" 3 target triple = "i386-pc-linux-gnu" 4 %struct.__fundamental_type_info_pseudo = type { %struct.__type_info_pseudo } 5 %struct.__type_info_pseudo = type {...