search for: arraydecay

Displaying 20 results from an estimated 20 matches for "arraydecay".

2012 Aug 20
3
[LLVMdev] Problem with "Does not dominate all uses"
.... If I run the rest of my pass, I obtain this code (see safer.phi.obfu.ll) And I got this error for the file safer.phi.obfu.ll: Instruction does not dominate all uses! %18 = load i8** %key.addr, align 8, !dbg !322 call void @Safer_Expand_Userkey(i8* %18, i8* %19, i32 %cond.reload, i32 0, i8* %arraydecay), !dbg !322 Instruction does not dominate all uses! %19 = load i8** %key.addr, align 8, !dbg !322 call void @Safer_Expand_Userkey(i8* %18, i8* %19, i32 %cond.reload, i32 0, i8* %arraydecay), !dbg !322 Broken module found, compilation aborted! 0 opt 0x0000000000946d3f 1 opt...
2012 Aug 20
0
[LLVMdev] Problem with "Does not dominate all uses"
...ss, I obtain this code (see safer.phi.obfu.ll) > > And I got this error for the file safer.phi.obfu.ll: > > Instruction does not dominate all uses! > %18 = load i8** %key.addr, align 8, !dbg !322 > call void @Safer_Expand_Userkey(i8* %18, i8* %19, i32 %cond.reload, i32 0, i8* %arraydecay), !dbg !322 > Instruction does not dominate all uses! > %19 = load i8** %key.addr, align 8, !dbg !322 > call void @Safer_Expand_Userkey(i8* %18, i8* %19, i32 %cond.reload, i32 0, i8* %arraydecay), !dbg !322 > Broken module found, compilation aborted! > 0 opt 0x00000000...
2019 Jul 24
2
Intrinsics InstrReadMem memory properties
Ok, now I think I've found a bug: Consider this C code: void bar(int b) { int a[10]; memset(a, b, 10); } which generates this IR code: define dso_local void @bar(i32 %b) #0 { entry: %b.addr = alloca i32, align 4 %a = alloca [10 x i32], align 16 store i32 %b, i32* %b.addr, align 4 %arraydecay = getelementptr inbounds [10 x i32], [10 x i32]* %a, i64 0, i64 0 %0 = bitcast i32* %arraydecay to i8* %1 = load i32, i32* %b.addr, align 4 %2 = trunc i32 %1 to i8 call void @llvm.memset.p0i8.i64(i8* align 16 %0, i8 %2, i64 10, i1 false) ret void } Now I have a pass that inserts an intri...
2014 Apr 11
2
[LLVMdev] llvm cse optimization
...g on the across the subprogram call optimization, and let's say the following llvm IR, @ng0 = internal global [2 x i32] [i32 2, i32 0], align 4 %t7 = alloca [16 x i8], align 16 %add.ptr = getelementptr inbounds i8* %t1, i64 40 %call = call i8* @handle_value(i8* %add.ptr, i32 3) #3 %arraydecay = getelementptr inbounds [8 x i8]* %t3, i64 0, i64 0 %arraydecay1 = getelementptr inbounds [16 x i8]* %t4, i64 0, i64 0 call void @select_value(i8* %arraydecay, i32 1, i32 1, i8* %call, i8* %arraydecay1, i8* null, i32 1, i32 2, i32 1, i8* bitcast ([2 x i32]* @ng0 to i8*), i32 32, i32 1) #3 %ca...
2011 Dec 16
3
[LLVMdev] load widening conflicts with AddressSanitizer
...yout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" define i32 @foo() nounwind uwtable { entry: %a = alloca [22 x i8], align 16 %arraydecay = getelementptr inbounds [22 x i8]* %a, i64 0, i64 0 call void @init(i8* %arraydecay) nounwind %arrayidx = getelementptr inbounds [22 x i8]* %a, i64 0, i64 16 %0 = bitcast i8* %arrayidx to i64* %1 = load i64* %0, align 16 <<<<<<<<<<<<<<<<<&...
2016 Dec 28
3
why clang compile local to global
...tore i32 8, i32* %c, align 4 store i32 9, i32* %d, align 4 store i32 10, i32* %e, align 4 store i32 11, i32* %f, align 4 %1 = load i32, i32* %b, align 4 %2 = load i32, i32* %c, align 4 %3 = load i32, i32* %d, align 4 %4 = load i32, i32* %e, align 4 %5 = load i32, i32* %f, align 4 %arraydecay = getelementptr inbounds [3 x i32], [3 x i32]* %a, i32 0, i32 0 call void @test(i32 signext %1, i32 signext %2, i32 signext %3, i32 signext %4, i32 signext %5, i32* %arraydecay) ret i32 0;} I want to known how to compile local array a to a local variable Thank you -------------- next part -...
2016 Dec 28
0
why clang compile local to global
...9, i32* %d, align 4 > store i32 10, i32* %e, align 4 > store i32 11, i32* %f, align 4 > %1 = load i32, i32* %b, align 4 > %2 = load i32, i32* %c, align 4 > %3 = load i32, i32* %d, align 4 > %4 = load i32, i32* %e, align 4 > %5 = load i32, i32* %f, align 4 > %arraydecay = getelementptr inbounds [3 x i32], [3 x i32]* %a, i32 0, i32 0 > call void @test(i32 signext %1, i32 signext %2, i32 signext %3, i32 signext %4, i32 signext %5, i32* %arraydecay) > ret i32 0;} > I want to known how to compile local array a to a local variable Your question is not t...
2011 Dec 16
0
[LLVMdev] load widening conflicts with AddressSanitizer
...8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" > target triple = "x86_64-unknown-linux-gnu" > > define i32 @foo() nounwind uwtable { > entry: > %a = alloca [22 x i8], align 16 > %arraydecay = getelementptr inbounds [22 x i8]* %a, i64 0, i64 0 > call void @init(i8* %arraydecay) nounwind > %arrayidx = getelementptr inbounds [22 x i8]* %a, i64 0, i64 16 > %0 = bitcast i8* %arrayidx to i64* > %1 = load i64* %0, align 16<<<<<<<<<<<&l...
2019 May 29
2
Problem of getNumOperands() for CallInst
Hi all, I got a interesting problem when calling getNumOperands() of CallInst. For example, call void @_Z2f2PA100_i([100 x i32]* nonnull %arraydecay) If I use getNumOperands(), it will return 2. However, if I use getCalledFunction()->getNumParams(), it will return 1. According to the IR, I think the number of operands of the call instruction should be 1. I wonder what is going on for this situation. Thanks in advance for...
2011 Dec 16
2
[LLVMdev] load widening conflicts with AddressSanitizer
...8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" > target triple = "x86_64-unknown-linux-gnu" > > define i32 @foo() nounwind uwtable { > entry: > %a = alloca [22 x i8], align 16 > %arraydecay = getelementptr inbounds [22 x i8]* %a, i64 0, i64 0 > call void @init(i8* %arraydecay) nounwind > %arrayidx = getelementptr inbounds [22 x i8]* %a, i64 0, i64 16 > %0 = bitcast i8* %arrayidx to i64* > %1 = load i64* %0, align 16 <<<<<<<<<<<<&...
2011 Aug 17
2
[LLVMdev] Non "folding" Stack Allocation
...ine void @_Z8functionb(i1 zeroext %b) { entry: %b1 = alloca [1024 x i8], align 1 ; <[1024 x i8]*> [#uses=1] %b2 = alloca [1024 x i8], align 1 ; <[1024 x i8]*> [#uses=1] %b3 = alloca [524288 x i8], align 1 ; <[524288 x i8]*> [#uses=1] %arraydecay = getelementptr inbounds [1024 x i8]* %b1, i64 0, i64 0 ; <i8*> [#uses=2] br i1 %b, label %if.then, label %if.else if.then: ; preds = %entry %arraydecay2 = getelementptr inbounds [1024 x i8]* %b2, i64 0, i64 0 ; <i8*> [#uses=1] call void @...
2019 Jul 25
2
Intrinsics InstrReadMem memory properties
...: > void bar(int b) { > int a[10]; > memset(a, b, 10); > } > > which generates this IR code: > define dso_local void @bar(i32 %b) #0 { > entry: > %b.addr = alloca i32, align 4 > %a = alloca [10 x i32], align 16 > store i32 %b, i32* %b.addr, align 4 > %arraydecay = getelementptr inbounds [10 x i32], [10 x i32]* %a, i64 0, > i64 0 > %0 = bitcast i32* %arraydecay to i8* > %1 = load i32, i32* %b.addr, align 4 > %2 = trunc i32 %1 to i8 > call void @llvm.memset.p0i8.i64(i8* align 16 %0, i8 %2, i64 10, i1 > false) > ret void > }...
2019 Jul 24
2
Intrinsics InstrReadMem memory properties
Hi Johannes, Thanks for your reply. I now see more clearly how things work with these properties. However, what would be an object whose address is potentially known by a callee? I suppose the intrinsic arguments and global variable? So IIUC, if not restricted by *only properties, an intrinsic could access to: - only its arguments if IntrArgMemOnly specified, - its arguments and the global
2011 Dec 16
0
[LLVMdev] load widening conflicts with AddressSanitizer
...-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" > > target triple = "x86_64-unknown-linux-gnu" > > > > define i32 @foo() nounwind uwtable { > > entry: > > %a = alloca [22 x i8], align 16 > > %arraydecay = getelementptr inbounds [22 x i8]* %a, i64 0, i64 0 > > call void @init(i8* %arraydecay) nounwind > > %arrayidx = getelementptr inbounds [22 x i8]* %a, i64 0, i64 16 > > %0 = bitcast i8* %arrayidx to i64* > > %1 = load i64* %0, align 16 > <<<<<<...
2013 Dec 05
0
[LLVMdev] Help with replacing instructions via function pass
Hi, In my IR code, I have the following: %arr = alloca [30 x i8], align 1 %arraydecay = getelementptr inbounds [16 x i8]* %arr, i32 0, i32 0 %arraydecay1 = getelementptr inbounds [16 x i8]* %arr, i32 0, i32 0 I'm trying to change the capacity of arr via a function pass. I've written the following code in my function pass: ArrayType* b = ArrayType::get(IntegerType::get(getG...
2014 Nov 03
8
[LLVMdev] [PATCH] Protection against stack-based memory corruption errors using SafeStack
...c + +; LINUX-X64: test1a: +; LINUX-X64-NOT: movq %fs:640 +; LINUX-X64: .cfi_endproc + +; DARWIN-X64: test1a: +; DARWIN-X64-NOT: movq ___llvm__unsafe_stack_ptr +; DARWIN-X64: .cfi_endproc + %a.addr = alloca i8*, align 8 + %buf = alloca [16 x i8], align 16 + store i8* %a, i8** %a.addr, align 8 + %arraydecay = getelementptr inbounds [16 x i8]* %buf, i32 0, i32 0 + %0 = load i8** %a.addr, align 8 + %call = call i8* @strcpy(i8* %arraydecay, i8* %0) + %arraydecay1 = getelementptr inbounds [16 x i8]* %buf, i32 0, i32 0 + %call2 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str,...
2013 Feb 14
1
[LLVMdev] LiveIntervals analysis problem
...gn 4, !tbaa !3 call void @_Bfree(%struct._reent* %ptr, %struct._Bigint* %0) nounwind store %struct._Bigint* null, %struct._Bigint** %_result, align 4, !tbaa !4 br label %if.end if.end: ; preds = %entry, %if.then %pe = bitcast double* %du to i16* %arraydecay = getelementptr inbounds [13 x i16]* %e, i32 0, i32 0 call fastcc void @e53toe(i16* %pe, i16* %arraydecay) %arrayidx.i.i = getelementptr inbounds [13 x i16]* %e, i32 0, i32 9 %3 = load i16* %arrayidx.i.i, align 2, !tbaa !5 %and.i.i = and i16 %3, 32767 %cmp.i.i = icmp eq i16 %and.i.i, 3276...
2019 Feb 07
2
RFC: [DebugInfo] Improving Debug Information in LLVM to Recover Optimized-out Function Parameters
...used for DILocalVariable construction. For call-site information, new DINode metadata DICallSite and DICallSiteParam are defined and these are emitted by the Clang frontend. The metadata is associated to the call or invoke IR instruction. Here is an example: %call5 = call i32 @fed_em_strncmp(i8* %arraydecay, i8* %arraydecay1, i64 5), !dbg !114, !call_site !101 … !99 = !DICallSiteParam(argno: 1, variable: !91, expr: !DIExpression()) !100 = !DICallSiteParam(argno: 2, variable: !95, expr: !DIExpression()) !101 = !DICallSite(scope: !87, file: !3, parameters: !102, line: 40, calledSubprogram: !13) !102 = !...
2019 Feb 08
3
RFC: [DebugInfo] Improving Debug Information in LLVM to Recover Optimized-out Function Parameters
...parameter. > For call-site information, new DINode metadata DICallSite and DICallSiteParam are defined and these are emitted by the Clang frontend. The metadata is associated to the call or invoke IR instruction. Here is an example: > > %call5 = call i32 @fed_em_strncmp(i8* %arraydecay, i8* %arraydecay1, i64 5), !dbg !114, !call_site !101 > … > !99 = !DICallSiteParam(argno: 1, variable: !91, expr: !DIExpression()) > !100 = !DICallSiteParam(argno: 2, variable: !95, expr: !DIExpression()) > !101 = !DICallSite(scope: !87, file: !3, parameters: !102, line:...
2019 Feb 08
2
RFC: [DebugInfo] Improving Debug Information in LLVM to Recover Optimized-out Function Parameters
...ion, new DINode metadata DICallSite and > DICallSiteParam are defined and these are emitted by the Clang frontend. > The metadata is associated to the call or invoke IR instruction. Here is > an example: > > > > %call5 = call i32 @fed_em_strncmp(i8* %arraydecay, i8* %arraydecay1, > i64 5), !dbg !114, !call_site !101 > > … > > !99 = !DICallSiteParam(argno: 1, variable: !91, expr: > !DIExpression()) > > !100 = !DICallSiteParam(argno: 2, variable: !95, expr: > !DIExpression()) > > !...