llvm-upgrade cannot distinguish between int tmp & uint tmp etc. #1628
Labels
bugzilla
Issues migrated from bugzilla
llvm-tools
All llvm tools that do not have corresponding tag
miscompilation
Extended Description
(Mis-upgradation. No warning issued.)
The following testcase should be self-explanatory... llvm-upgrade can't pick
the correct %tmp when both int %tmp and uint %tmp are defined. Similar problem
occurs with sbyte and ubyte.
Testcase: zxc.ll:
target datalayout = "e-p:32:32"
target endian = little
target pointersize = 32
target triple = "i686-pc-linux-gnu"
implementation ; Functions:
void %_Z4func() {
entry:
%tmp = add int 0, 0
%tmp = add uint 1, 1
%tmp = add ubyte 1, 2
%tmp = add sbyte 2, 3
call void %f (int %tmp)
call void %g (ubyte %tmp)
ret void
}
declare void %f(int)
declare void %g(ubyte)
Output of $llvm-upgrade zxc.ll
; ModuleID = 'zxc.ll'
target datalayout = "e-p:32:32"
target triple = "i686-pc-linux-gnu"
implementation ; Functions:
define void @_Z4func() {
entry:
%tmp = add i32 0, 0 ; [#uses=0]
%tmp.upgrd.1 = add i32 1, 1 ; [#uses=1]
%tmp.upgrd.2 = add i8 1, 2 ; [#uses=0]
%tmp.upgrd.3 = add i8 2, 3 ; [#uses=1]
call void @f( i32 %tmp.upgrd.1 )
call void @g( i8 %tmp.upgrd.3 )
ret void
}
declare void @f(i32)
declare void @g(i8)
Expected output:
; ModuleID = 'zxc.ll'
target datalayout = "e-p:32:32"
target triple = "i686-pc-linux-gnu"
implementation ; Functions:
define void @_Z4func() {
entry:
%tmp = add i32 0, 0 ; [#uses=0]
%tmp.upgrd.1 = add i32 1, 1 ; [#uses=1]
%tmp.upgrd.2 = add i8 1, 2 ; [#uses=0]
%tmp.upgrd.3 = add i8 2, 3 ; [#uses=1]
call void @f( i32 %tmp ) ; XXX
call void @g( i8 %tmp.upgrd.2 ) ; XXX
ret void
}
declare void @f(i32)
declare void @g(i8)
The text was updated successfully, but these errors were encountered: