Displaying 3 results from an estimated 3 matches for "isx86_mmxti".
Did you mean:
isx86_mmxty
2015 Jun 09
2
[LLVMdev] Constant folding inttoptr i32 0 to null pointer?
On Tue, Jun 9, 2015 at 12:32 PM, David Majnemer <david.majnemer at gmail.com>
wrote:
> 'load volatile i32 addrspace(1)* null' seems fine to me. However, it
> looks like instcombine will turn:
> define i32 @foo() {
> entry:
> %std_ld.i = load volatile i32, i32 addrspace(1)* null
> ret i32 %std_ld.i
> }
>
> into:
> define i32 @foo() {
> entry:
2015 Jun 09
4
[LLVMdev] Constant folding inttoptr i32 0 to null pointer?
Thanks David,
It turns out, that the address space I was using was not 0, and yet the pointer was constant folded to null.
Here is the sequence:
Unoptimized code:
define i32 @foo() #0 {
entry:
%address.addr.i = alloca i32, align 4
%value.i = alloca i32, align 4
store i32 0, i32* %address.addr.i, align 4
%0 = load i32* %address.addr.i, align 4
%1 = inttoptr i32 %0 to i32 addrspace(1)*
2015 Jun 09
2
[LLVMdev] Constant folding inttoptr i32 0 to null pointer?
Hello,
It seems that ConstantFoldCastInstruction in ConstantFold.cpp folds inttoptr instruction with 0 as operand to a null pointer. It makes sense, when talking about a C-style frontend, as the C99 spec (6.3.2.3) states:
"An integer constant expression with the value 0, or such an expression cast to type void *, is called a null pointer constant."
On the other hand, some architectures