Displaying 20 results from an estimated 205 matches for "p0i8".
2014 Oct 17
2
[LLVMdev] opt -O2 leads to incorrect operation (possibly a bug in the DSE)
Hi all,
Consider the following example:
define void @fn(i8* %buf) #0 {
entry:
%arrayidx = getelementptr i8* %buf, i64 18
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %arrayidx, i8* %buf, i64
18, i32 1, i1 false)
%arrayidx1 = getelementptr i8* %buf, i64 18
store i8 1, i8* %arrayidx1, align 1
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %buf, i8* %arrayidx, i64
18, i32 1, i1 false)
ret void
}
I ran opt -O2 ex.ll -S, and got:
define void @f...
2017 Mar 31
2
CHECK-LABLE or CHECK?
Hi All,
I came across a FileCheck failure I don't understand why. The
example code below:
void test1() {
... code ...
// CHECK-LABEL: @test1
// CHECK: void @llvm.memcpy.p0i8.p0i8.i32 - (1)
}
void dummy() { // make (1) match
... code ...
// CHECK-LABEL: @dummy
}
void test2() {
... code ...
// CHECK-LABEL: @test2
// CHECK: void @llvm.memcpy.p0i8.p0i8.i32
}
Here what I want to match are the two llvm.memcpy instructio...
2013 May 21
4
[LLVMdev] malloc / free & memcpy optimisations.
The front end I'm building for an existing interpreted language is
unfortunately producing output similar to this far too often;
define void @foo(i8* nocapture %dest, i8* nocapture %src, i32 %len)
nounwind {
%1 = tail call noalias i8* @malloc(i32 %len) nounwind
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %1, i8* %src, i32 %len, i32
1, i1 false)
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %len,
i32 1, i1 false)
tail call void @free(i8* %1) nounwind
ret void
}
I'd like to be able to reduce this pattern to this;
define void @foo(i8* nocapture %dest, i8* no...
2020 Sep 30
2
lifetime_start/end
...s. In the following
code section, they seem redundant. However, when I remove them, the
behavior of the code becomes non-deterministic. The live ranges of the
variables defined by them are never used in the code.
Thanks,
---------------
%37 = bitcast i32* %7 to i8*
call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %37) #5
store i32 0, i32* %7, align 4, !tbaa !4
%38 = bitcast i32* %8 to i8*
call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %38) #5
store i32 99, i32* %8, align 4, !tbaa !4
%39 = bitcast i32* %9 to i8*
call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %39...
2012 Jul 26
1
[LLVMdev] llvm.memset.p0i8.* intrinsics
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
are the llvm.memset.p0i8.i32 and llvm.memset.p0i8.i64 intrinsics meant
to be used for 32-bit and 64-bit architectures, respectively depending
on the module's target datalayout? Or can I use any of them? If yes,
why are there two functions?
Sorry, if it's obvious, but the documentation wasn't that clear.
Thanks...
2018 Mar 22
2
new @llvm.memcpy and @llvm.memset API in trunk - how to use alignment?
...have an alignment parameter. Instead the
docs say to use the align <n> attribute. How is this supposed to work with
different alignments?
For example, I have one memcpy with align 4, align 4, and another with
align 1, align 1.
; Function Attrs: argmemonly nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly align 4,
i8* nocapture readonly align 4, i64, i1) #3
; Function Attrs: argmemonly nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64.1(i8* nocapture writeonly align 1,
i8* nocapture readonly align 1, i64, i1) #3
When I add these multiple definitions to the module,...
2018 Nov 23
2
is this a bug in an optimization pass?
...declare(metadata, metadata, metadata) #1
; Function Attrs: nobuiltin nounwind
define void @entry() #2 !dbg !41 {
Entry:
%array = alloca [10 x %Bar], align 4
%x = alloca %Bar, align 4
%for_index = alloca i64, align 8
%0 = bitcast [10 x %Bar]* %array to i8*, !dbg !60
call void @llvm.memset.p0i8.i64(i8* align 4 %0, i8 -86, i64 80, i1
false), !dbg !60
call void @llvm.dbg.declare(metadata [10 x %Bar]* %array, metadata
!45, metadata !DIExpression()), !dbg !60
store i64 0, i64* %for_index, align 8, !dbg !61
call void @llvm.dbg.declare(metadata i64* %for_index, metadata !55,
metadata !DIE...
2017 May 16
4
Which pass should be propagating memory copies
Consider the following IR example:
define void @simple([4 x double] *%ptr, i64 %idx) {
%stack = alloca [4 x double]
%ptri8 = bitcast [4 x double] *%ptr to i8*
%stacki8 = bitcast [4 x double] *%stack to i8*
call void @llvm.memcpy.p0i8.p0i8.i32(i8 *%stacki8, i8 *%ptri8, i32 32,
i32 0, i1 0)
%dataptr = getelementptr inbounds [4 x double], [4 x double] *%ptr, i32
0, i64 %idx
store double 0.0, double *%dataptr
call void @llvm.memcpy.p0i8.p0i8.i32(i8 *%ptri8, i8 *%stacki8, i32 32,
i32 0, i1 0)
ret void
}
I would lik...
2013 May 21
0
[LLVMdev] malloc / free & memcpy optimisations.
...ng for an existing interpreted language is
> unfortunately producing output similar to this far too often;
>
> define void @foo(i8* nocapture %dest, i8* nocapture %src, i32 %len)
> nounwind {
> %1 = tail call noalias i8* @malloc(i32 %len) nounwind
> tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %1, i8* %src, i32 %len,
> i32 1, i1 false)
> tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %len,
> i32 1, i1 false)
> tail call void @free(i8* %1) nounwind
> ret void
> }
>
> I'd like to be able to reduce this pattern to this;
>
&...
2012 May 22
4
[LLVMdev] How to get llvm bitcode executed
...a_rethrow()
declare void @__cxa_end_catch()
declare void @__cxa_call_unexpected(i8*)
declare void @_ZdlPv(i8*) nounwind
declare void @_ZSt20__throw_length_errorPKc(i8*) noreturn
declare void @_ZSt17__throw_bad_allocv() noreturn
declare noalias i8* @_Znwm(i64)
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
declare void @llvm.memmove.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
declare i32 @llvm.atomic.load.add.i32.p0i32(i32* nocapture, i32) nounwind
declare void @llvm.memory.barrier(i1, i1, i1, i1, i1) nounwind...
2018 Jan 19
0
Change memcpy/memmove/memset to have dest and source alignment attributes
...ion on my part; perhaps, I used non-standard terminology to refer to a CallInst’s parameter attributes. I am not touching the definition of PointerType in any way; I don’t see the need, and I’m not that ambitious. ;-) Currently, a call to @llvm.memcpy might look like this:
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
where the ‘i32 4’ argument (2nd last arg) is the minimum alignment of both of the pointer args (%src & %dest). After this change, this same call will instead read:
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %sr...
2012 Mar 12
2
[LLVMdev] LLI Segfaulting
...t;(%MainClass* nocapture %this_ptr) nounwind
{
allocas:
%0 = getelementptr inbounds %MainClass* %this_ptr, i64 0, i32 0, i32 0
store i32 5, i32* %0, align 4
%1 = getelementptr inbounds %MainClass* %this_ptr, i64 0, i32 0, i32 1
%2 = bitcast [0 x i32]* %1 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %2, i8* bitcast ([5 x i32]*
@.gvar_array to i8*), i64 20, i32 4, i1 false)
ret void
}
define void @main() nounwind {
allocas:
%0 = alloca { i32, [0 x i32] }, align 8
%1 = getelementptr inbounds { i32, [0 x i32] }* %0, i64 0, i32 0
store i32 5, i32* %1, align 8
%2 = getelemen...
2018 Jan 19
2
Change memcpy/memmove/memset to have dest and source alignment attributes
...rtantly for those maintaining downstream users of the LLVM API, this changes the prototypes for the @llvm.memcpy/memmove/memset intrinsics and changes the IRBuilder API for creating memcpy and memmove calls.
>>
>> For example, IR which used to read:
>> call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
>> will now read
>> call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)
>>
>> The LLVM change includes auto upgrade of the old IR. However, match expressions in IR tests a...
2012 Aug 22
4
[LLVMdev] PROPOSAL: IR representation of detailed struct assignment information
...he capability to represent
TBAA information for the members of the fields in a struct assignment.
Here's an example showing the basic problem:
struct bar {
char x;
float y;
double z;
};
void copy_bar(struct bar *a, struct bar *b) {
*a = *b;
}
We get this IR:
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* %1, i64 16, i32 8, i1 false)
This works, but it doesn't retain the information that the bytes between fields
x and y don't really need to be copied, and it doesn't inform the optimizer
that there are three fields with TBAA-relevant types being copied.
The solution...
2018 Mar 22
0
new @llvm.memcpy and @llvm.memset API in trunk - how to use alignment?
...t; the docs say to use the align <n> attribute. How is this supposed to
> work with different alignments?
>
> For example, I have one memcpy with align 4, align 4, and another with
> align 1, align 1.
>
> ; Function Attrs: argmemonly nounwind
> declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly align
> 4, i8* nocapture readonly align 4, i64, i1) #3
>
> ; Function Attrs: argmemonly nounwind
> declare void @llvm.memcpy.p0i8.p0i8.i64.1(i8* nocapture writeonly
> align 1, i8* nocapture readonly align 1, i64, i1) #3
>
>
> When I add the...
2018 Nov 29
2
AliasAnalysis does not look though a memcpy
...%var.addr = alloca i32*, align 8
store i32* %var, i32** %var.addr, align 8
; Memcpy `var.addr' to `var.addr.tmp'
%var.addr.tmp = alloca i32*, align 8
%0 = bitcast i32** %var.addr.tmp to i8*
%1 = bitcast i32** %var.addr to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %0, i8* align 8 %1, i64 8, i1 false)
; Load a copy of `var'
%var.tmp = load i32*, i32** %var.addr.tmp
%should.be.42 = load i32, i32* %var.tmp
ret void
}
; Function Attrs: argmemonly nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* n...
2018 Jan 02
5
Change memcpy/memmove/memset to have dest and source alignment attributes
...41677 (Clang part)
Importantly for those maintaining downstream users of the LLVM API, this changes the prototypes for the @llvm.memcpy/memmove/memset intrinsics and changes the IRBuilder API for creating memcpy and memmove calls.
For example, IR which used to read:
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
will now read
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)
The LLVM change includes auto upgrade of the old IR. However, match expressions in IR tests and calls to IRBuilder’s CreateMemCpy...
2010 May 05
2
[LLVMdev] Why llvm function name is different with . and ..
declare i8 @llvm.atomic.load.max.i8.p0i8( i8* <ptr>, i8 <delta> )
declare i16 @llvm.atomic.load.max.i16.p0i16( i16* <ptr>, i16 <delta> )
declare i32 @llvm.atomic.load.max.i32.p0i32( i32* <ptr>, i32 <delta> )
declare i64 @llvm.atomic.load.max.i64.p0i64( i64* <ptr>, i64 <delta> )
decla...
2012 Jan 23
2
[LLVMdev] Possible bug in the dragonegg
...in(i32 %argc, i8** nocapture %argv) nounwind uwtable ssp {
entry:
%memtmp = alloca [15 x i8], align 1
%memtmp1 = alloca [15 x i8], align 1
%0 = getelementptr inbounds [15 x i8]* %memtmp, i64 0, i64 0
%1 = getelementptr inbounds [15 x i8]* %memtmp1, i64 0, i64 0
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* getelementptr
inbounds ([15 x i8]* @.cst, i64 0, i64 0), i64 15, i32 1, i1 false)
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* getelementptr
inbounds ([15 x i8]* @.cst1, i64 0, i64 0), i64 15, i32 1, i1 false)
%2 = call i64 @strlen(i8* %0) nounwind readonly
%3 =...
2012 May 22
0
[LLVMdev] How to get llvm bitcode executed
...cxa_end_catch()
> declare void @__cxa_call_unexpected(i8*)
> declare void @_ZdlPv(i8*) nounwind
> declare void @_ZSt20__throw_length_errorPKc(i8*) noreturn
> declare void @_ZSt17__throw_bad_allocv() noreturn
> declare noalias i8* @_Znwm(i64)
> declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
> declare void @llvm.memmove.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
> declare i32 @llvm.atomic.load.add.i32.p0i32(i32* nocapture, i32) nounwind
> declare void @llvm.memory.barrier(i1, i1, i1, i1...