[LLVMbugs] [Bug 13042] New: incorrect optimization where i64 is converted to i192
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed Jun 6 15:50:28 PDT 2012
http://llvm.org/bugs/show_bug.cgi?id=13042
Bug #: 13042
Summary: incorrect optimization where i64 is converted to i192
Product: new-bugs
Version: unspecified
Platform: PC
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P
Component: new bugs
AssignedTo: unassignedbugs at nondot.org
ReportedBy: nmatsakis at mozilla.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
Created attachment 8690
--> http://llvm.org/bugs/attachment.cgi?id=8690
bitcode demonstrating the problem
I am attaching a .bc file for a single function. The unoptimized version
includes this code:
```
%15 = bitcast %"enum parse::token::token[#0]"* %3 to { i64, i8 }*
%16 = getelementptr inbounds { i64, i8 }* %15, i32 0, i32 0
%17 = load i64* %16
switch i64 %17, label %match_else28672 [
i64 35, label %match_case28673
]
```
which is compiled into this code:
```
%10 = bitcast i8* addrspace(1)* %9 to i192 addrspace(1)*
%srcval = load i192 addrspace(1)* %10, align 1
%11 = and i192 %srcval, 340282366920938463481821351505477763071
%12 = icmp eq i192 %11, 35
br i1 %12, label %call28676, label %case_body28671
```
It seems to me that the computation of %11 is incorrect. It is masking with
0x10000000000000000ffffffffffffffff but it ought to be masking with
0xffffffffffffffff.
(This is a little endian system)
--
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