Displaying 20 results from an estimated 78 matches for "ptr1".
Did you mean:
ptr
2011 Oct 07
2
[LLVMdev] Aliasing confusion
Hi all,
I'm having trouble understanding how llvm determines if pointers
alias. Consider the following two functions that each do a redundant
load:
define float @A(float * noalias %ptr1) {
%ptr2 = getelementptr float* %ptr1, i32 1024
%val1a = load float* %ptr1
store float %val1a, float* %ptr2
%val1b = load float* %ptr1
ret float %val1b
}
define float @B(float * noalias %ptr1, float * noalias %ptr2) {
%val1a = load float* %ptr1
store float %val1a, float* %ptr2
%va...
2011 Oct 07
0
[LLVMdev] Aliasing confusion
...Oct 7, 2011 at 2:15 PM, andrew adams <andrew.b.adams at gmail.com> wrote:
> Hi all,
>
> I'm having trouble understanding how llvm determines if pointers
> alias. Consider the following two functions that each do a redundant
> load:
>
> define float @A(float * noalias %ptr1) {
> %ptr2 = getelementptr float* %ptr1, i32 1024
> %val1a = load float* %ptr1
> store float %val1a, float* %ptr2
> %val1b = load float* %ptr1
> ret float %val1b
> }
>
>
> define float @B(float * noalias %ptr1, float * noalias %ptr2) {
> %val1a = load float...
2015 Jun 18
1
Re: [PATCH v4 2/3] do_btrfs_subvolume_list: fix a bad return value
...rfssubvolume))
fails, then ret->guestfs_int_btrfssubvolume_list_val is already a null
pointer, which means you can just check for it as you do in (1) above,
with no need to switch from malloc to calloc.
The other alternative is to use more labels for error conditions in a
symmetric way, like:
ptr1 = malloc (...);
if (ptr1 == NULL)
goto error1;
ptr1->subptr1 = malloc (...);
if (ptr1->subptr1 == NULL)
goto error2;
ptr1->subptr2 = malloc (...);
if (ptr1->subptr2 == NULL)
goto error3;
...
error3:
free (ptr1->subptr1);
error2:
free (ptr1);
error1:
...
-...
2009 Jul 10
2
[LLVMdev] Help: Instruction Pattern Matching question
...let Namespce = "MyNameSpace";
MyOpCode myop = op;
MySubOpcode mysubop = subop;
dag OutOprandList = outs;
dag InOprandList = ins;
let ASMString = asmstr;
let Pattern = pattern;
}
def My_ADDINST1: MyInst <MYADD1, NO_SUBOP,
(outs ptr_rc: $dest), (ins: $ptr_rc:$ptr1, Int32RC:$src)
"myadd1 $dst, $ptr1, $src1",
[(set $ptr_rc:$dst,(add $ptr_rc:ptr1, Int32RC:$src))]>;
it is giving me error like impossible to select.
Could anybody help me resolve this issue. Any example would be highly appreciated.
2020 Jun 19
2
Aliasing and forwarding optimization
----Snip--
struct st1{
int a;
};
struct st2{
int b;
};
struct st {
struct st1 obj1;
struct st2 obj2;
}Obj;
int test1(struct st1 * ptr1 , struct st2 * ptr2, struct st2 *ptr3) {
ptr1->a = 10;
*ptr3 = *ptr2;
return ptr1->a;
}
--Snip---
For the above case GCC is able to store forward the value 10 to the return
place.
LLVM is not doing this.
GCC
https://godbolt.org/z/FCjCXy
LLVM
https://godbolt.org/z/TFgnig
My understandi...
2013 May 20
1
Inconsistent results from .C()
..., but
have not found anything untoward.
Any suggestions would be much appreciated!
Regards,
Robin
# THESE COMMANDS GIVE ONE ANSWER
# [the correct answer always begins with 1, the incorrect with -1]
> .C("oneMargin", c(1L,1L,1L,1L,1L), c(1L,1L,1L,1L,1L), 1L, c(2L,2L,2L,2L,2L), 5L, ptr1, ptr2)[[7]]
[1] 1 -1 -1 1 -1 1 1 -1 -1 1 1 -1 1 -1 -1 1 -1 1 1 -1 1 -1
-1 1 1 -1 -1 1 -1 1 1 -1
> dput(.C("oneMargin", c(1L,1L,1L,1L,1L), c(1L,1L,1L,1L,1L), 1L, c(2L,2L,2L,2L,2L), 5L, ptr1, ptr2)[[7]])
c(1L, -1L, -1L, 1L, -1L, 1L, 1L, -1L, -1L, 1L, 1L, -1L, 1L, -1L,
-1...
2002 Sep 14
1
[LLVMdev] MP1: Gelementptr question
The following is legal LLVM code in which ptr, ptr2, and ptr3 are all
aliases:
%struct = type { int, int }
implementation
int %p() {
%ptr1 = alloca %struct
%ptr2 = getelementptr %struct* %ptr1
%ptr3 = getelementptr %struct* %ptr2, uint 0
%pint = getelementptr %struct* %ptr3, uint 0, ubyte 0
%rval = load int* %pint
ret int %rval
}
Should our pass a) ignore this, not replace %ptr1, let copy-propagation
fix the problem, or b...
2004 Aug 24
5
MMX/mmxext optimisations
quite some speed improvement indeed.
attached the updated patch to apply to svn/trunk.
j
-------------- next part --------------
A non-text attachment was scrubbed...
Name: theora-mmx.patch.gz
Type: application/x-gzip
Size: 8648 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/theora-dev/attachments/20040824/5a5f2731/theora-mmx.patch-0001.bin
2011 Oct 26
3
[LLVMdev] Use still stuck around after Def is destroyed:
I made a GlobalVariable that is of type ConstantArray. For one of it's
elements I assigned it the ConstantExpr::getBitCast of another
GlobalVariable(the "shadow pointer" mentioned). This gives me:
While deleting: i32 (i32)** %Shadow Variable for ptr1
Use still stuck around after Def is destroyed:i8* bitcast (i32
(i32)** @"Shadow Variable for ptr1" to i8*)
opt: Value.cpp:75: virtual llvm::Value::~Value(): Assertion
`use_empty() && "Uses remain when a value is destroyed!"' failed.
I only see this a...
2020 Nov 10
1
llvm-ir: anonymous struct name mangling
...used for llvm-ir functions (See [0, 3]).
The problem is the following: Given:
%0 = type { i32 }
%1 = type { i32 }
Creating an intrinsic @llvm.FOO that accepts 'a pointer to %0' cannot be distinguished from the intrinsic accepting 'a pointer to %1':
;For a %0* ptr0, %1* ptr1
call @llvm.FOO.p0s_s %0* %ptr0
call @llvm.FOO.p0s_s %1* %ptr1 ; assertion failure: same name produced, but %ptr1 is not compatible with '%0*'
It seems that the name mangling is not coping well with anonymous structs ?
See: [1,2]: All anonymous structs get a 's_s' manglin...
2015 Jun 17
2
Re: [PATCH v4 2/3] do_btrfs_subvolume_list: fix a bad return value
On Wednesday 17 June 2015 16:19:32 Chen Hanxiao wrote:
> don't return a value which is to be freed.
>
> v4: use strndup
> v3: v3: fix test case failure
> Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
> ---
> daemon/btrfs.c | 26 +++++++++++++++++---------
> 1 file changed, 17 insertions(+), 9 deletions(-)
>
> diff --git a/daemon/btrfs.c
2011 Oct 26
0
[LLVMdev] Use still stuck around after Def is destroyed:
...rote:
> I made a GlobalVariable that is of type ConstantArray. For one of it's
> elements I assigned it the ConstantExpr::getBitCast of another
> GlobalVariable(the "shadow pointer" mentioned). This gives me:
>
> While deleting: i32 (i32)** %Shadow Variable for ptr1
> Use still stuck around after Def is destroyed:i8* bitcast (i32
> (i32)** @"Shadow Variable for ptr1" to i8*)
> opt: Value.cpp:75: virtual llvm::Value::~Value(): Assertion
> `use_empty() && "Uses remain when a value is destroyed!"' failed....
2013 Nov 14
0
[LLVMdev] [RFC] Scoped no-alias metadata (redux)
...ol dependencies on the noalias metadata because such dependencies could only present a problem when loads or stores are merged (RAUW is called), and transformations should drop metadata when that happens.
Now I'm worried that this is not true. Here's a simple example:
entry:
%x1 = load %ptr1 // loading from ptr here to make all subsequent loads of %ptr safe to speculate
%x2 = load %ptr2
...
somewhere:
...
call i_may_throw()
%y = load %ptr1, !alias.scope !{ !s1 }
...
%z = store %ptr2, !alias.scope !{ !s1 }, !noalias !{ !s1 }
So now some well-meaning pass swaps the order...
2013 Nov 04
3
[LLVMdev] [RFC] Scoped no-alias metadata (redux)
...ased on it...", and so we need to tag all loads and stores in some scope with the scope metadata, and then additionally tag the 'noalias' loads and stores that don't alias with the various loads and stores in that scope (not just with the other noalias loads and stores).
= load %ptr1, !alias.scope !scope1
= load %ptr2, !alias.scope !scope1, !noalias !scope1
Generally, when BasicAA is evaluating an aliasing query, if one of the instructions is associated with an alias.scope id that is identical to the noalias scope associated with the other instruction, or is a descendant (in...
2018 Mar 21
0
Finding which registers the operand of a load maps to
Appreciate all of the quick responses to my ridiculous questions so far.
Hoping this one attracts similarly good discussion!
Let's say I have the following series of instructions:
%a = load i32, i32* %ptr1
%b = load i32, i32* %ptr2
%c = add i32 %a, %b
store i32 %c, i32* %ptr3
This gets compiled (roughly) to
mov eax, dword ptr [rsp - 4]
add eax, dword ptr [rsp - 8]
mov dword ptr [rsp - 12], eax
In an opt pass, I would like to replace this series of four instructions
with a single intrin...
2013 Apr 05
4
[LLVMdev] A strange testing case of SROA
...to get to the correct
offset of
112 ; some type, not necessarily the dynamic vector.
113 ; This test makes sure we don't have this crash.
114 define float @test6(i32 %idx1, i32 %idx2) {
115 entry:
116 %0 = alloca %vector.pair
117 store %vector.pair zeroinitializer, %vector.pair* %0
118 %ptr1 = getelementptr %vector.pair* %0, i32 0, i32 0, i32 0, i32
0, i32 %idx1
119 store float 1.0, float* %ptr1
120 %ptr2 = getelementptr %vector.pair* %0, i32 0, i32 1, i32 0, i32
0, i32 %idx2
121 %ret = load float* %ptr2
122 ret float %ret
123 }
2001 Jul 05
1
Streaming buffers/ov_read question
...in my code was a song that i converted to the vorbis format
(Gorillaz - Cling Eastwood)
pcmData is defined like this: char pcmData[4096];
the ogg file and the directsound buffer (lpdsBuffer and vorbisFile) have
already been set up properly.
// code start
void PlaybackThread(void *param)
{
UCHAR *ptr1, *ptr2;
DWORD len1, len2;
long retVal;
int bytes_to_read = 4096;
int writeCursor = 0;
int bufferReadCursor = 0;
bool begPlay = true;
int len1_copy, len2_copy;
HWND hDlg = (HWND)param;
while (!eof)
{
if (bufferReadCursor > 4096)
{
// fill more data into the buffer;
bytes_to_r...
2011 Oct 27
1
[LLVMdev] Use still stuck around after Def is destroyed:
...e:
>
> I made a GlobalVariable that is of type ConstantArray. For one of it's
> elements I assigned it the ConstantExpr::getBitCast of another
> GlobalVariable(the "shadow pointer" mentioned). This gives me:
>
> While deleting: i32 (i32)** %Shadow Variable for ptr1
> Use still stuck around after Def is destroyed:i8* bitcast (i32
> (i32)** @"Shadow Variable for ptr1" to i8*)
> opt: Value.cpp:75: virtual llvm::Value::~Value(): Assertion
> `use_empty() && "Uses remain when a value is destroyed!"' failed....
2011 Nov 24
1
[LLVMdev] differences in IR and ELF?
...GlobalVariable *global = new GlobalVariable(M, type, true,
my_linkage, array,
"my array");
global->setSection(*my_section);
}
The IR looks like this:
@"my array" = constant [3 x i32*] [i32* bitcast (i32 (i32)** @"Shadow
Variable for ptr1" to i32*), i32* bitcast (i32 (i32)* @f2 to i32*),
i32* bitcast (i32 (i32)* @f1 to i32*)], section "my_section"
@"my array2" = constant [3 x i32*] [i32* bitcast (i32 (i32)** @"Shadow
Variable for ptr1" to i32*), i32* bitcast (i32 (i32)* @f1 to i32*),
i32* bitcast (...
2017 Aug 10
3
InstCombine GEP
> On Thu, Aug 10, 2017 at 12:22 AM, Nema, Ashutosh via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>> I’m not sure how transforming GEP offset to i8 type will help alias
>> analysis & SROA for the mentioned test case.
>
> It should neither help nor hinder AA or SROA -- the two GEPs (the complex one and the simple one) are equivalent. > Since memory isn't