[LLVMbugs] [Bug 6512] New: problem with INSTCOMBINE phi node with loads from different address spaces
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Fri Mar 5 10:03:27 PST 2010
http://llvm.org/bugs/show_bug.cgi?id=6512
Summary: problem with INSTCOMBINE phi node with loads from
different address spaces
Product: new-bugs
Version: trunk
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P5
Component: new bugs
AssignedTo: unassignedbugs at nondot.org
ReportedBy: bixia.zheng at amd.com
CC: llvmbugs at cs.uiuc.edu
Error message (opt -O3):
INSTCOMBINE ITERATION #0 on foo
....
IC: Visiting: br label %if.end
IC: Visiting: %res.0 = phi i32 [ %tmp2, %if.then ], [ %tmp5, %if.else ] ;
<i32> [#uses=1]
Assertion failed: getType() == V->getType() && "All operands to PHI node must
be the same type as the PHI node!", file ....\llvm\include\llvm/Instructions.h,
line 1821
Test case:
define i32 @foo(i32 addrspace(1)* %pointer1, i32 %flag, i32* %pointer2)
nounwind {
entry:
%retval = alloca i32, align 4 ; <i32*> [#uses=2]
%pointer1.addr = alloca i32 addrspace(1)*, align 4 ; <i32 addrspace(1)**>
[#uses=2]
%flag.addr = alloca i32, align 4 ; <i32*> [#uses=2]
%pointer2.addr = alloca i32*, align 4 ; <i32**> [#uses=2]
%res = alloca i32, align 4 ; <i32*> [#uses=4]
store i32 addrspace(1)* %pointer1, i32 addrspace(1)** %pointer1.addr
store i32 %flag, i32* %flag.addr
store i32* %pointer2, i32** %pointer2.addr
store i32 10, i32* %res
%tmp = load i32* %flag.addr ; <i32> [#uses=1]
%tobool = icmp ne i32 %tmp, 0 ; <i1> [#uses=1]
br i1 %tobool, label %if.then, label %if.else
return: ; preds = %if.end
%tmp7 = load i32* %retval ; <i32> [#uses=1]
ret i32 %tmp7
if.end: ; preds = %if.else, %if.then
%tmp6 = load i32* %res ; <i32> [#uses=1]
store i32 %tmp6, i32* %retval
br label %return
if.then: ; preds = %entry
%tmp1 = load i32 addrspace(1)** %pointer1.addr ; <i32 addrspace(1)*>
[#uses=1]
%arrayidx = getelementptr i32 addrspace(1)* %tmp1, i32 0 ; <i32
addrspace(1)*> [#uses=1]
%tmp2 = load i32 addrspace(1)* %arrayidx ; <i32> [#uses=1]
store i32 %tmp2, i32* %res
br label %if.end
if.else: ; preds = %entry
%tmp3 = load i32** %pointer2.addr ; <i32*> [#uses=1]
%arrayidx4 = getelementptr i32* %tmp3, i32 0 ; <i32*> [#uses=1]
%tmp5 = load i32* %arrayidx4 ; <i32> [#uses=1]
store i32 %tmp5, i32* %res
br label %if.end
}
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list