Displaying 2 results from an estimated 2 matches for "writes_over_everyth".
2014 May 23
2
[LLVMdev] GVN incorrectly handling readnone parameter attribute?
...information such as
knowing that %p != %q, or better, that %p is a local alloca or freshly
malloc'd memory and the pointer %p has not yet escaped (aka. been captured).
If we read the language as permitting the function to make copies of the
pointers the this code would be valid:
define void @writes_over_everything(i32* readnone %p, i32* readnone %q) {
%P = bitcast i32* %p to i32*
%Q = bitcast i32* %p to i32*
store i32 10, i32* %P
store i32 10, i32* %Q
ret void
}
and that's not useful for optimization.
Nick
> On 23 May 2014 04:22, Nick Lewycky <nlewycky at google.com> wrote:
>...
2014 May 23
2
[LLVMdev] GVN incorrectly handling readnone parameter attribute?
Confirmed, this is a bug. This
define i32* @get_pntr(i32* %p) nounwind uwtable {
entry:
ret i32* %p
}
define void @store(i32* %p) noinline nounwind uwtable {
entry:
%call = call i32* @get_pntr(i32* %p)
store i32 10, i32* %call, align 4
ret void
}
run through opt -functionattrs gets a 'readnone' on @store's %p. That's
wrong, it clearly stores to it. The bug is due to