[LLVMbugs] [Bug 1620] New: dead argument elimination loses parameter attributes

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Aug 23 04:55:09 PDT 2007


           Summary: dead argument elimination loses parameter attributes
           Product: libraries
           Version: 2.0
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Interprocedural Optimizations
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: jay.foad at antixlabs.com
                CC: llvmbugs at cs.uiuc.edu

I'm running under cygwin. I have a module with an internal function f() with a
dead argument. It also has a parameter attribute saying that the return value
should be sign-extended:

$ ~/llvm/objdir/Debug/bin/llvm-dis -o - deadarg.o
; ModuleID = 'deadarg.o'

define internal i16 @f(i32 %x) sext  {
        ret i16 3

define i16 @g() sext  {
        %retval = call i16 @f( i32 0 ) sext             ; <i16> [#uses=1]
        ret i16 %retval

I run the dead argument elimination pass on it:

$ ~/llvm/objdir/Debug/bin/opt -f -o opt.o deadarg.o -deadargelim

Now the dead argument has gone, but so has the sext attribute!

$ ~/llvm/objdir/Debug/bin/llvm-dis -o - opt.o
; ModuleID = 'opt.o'

define internal i16 @f() {
        ret i16 3

define i16 @g() sext  {
        %retval = call i16 @f( )                ; <i16> [#uses=1]
        ret i16 %retval

This seems wrong - removing one argument shouldn't affect how any of the other
arguments are passed or the return value is returned.

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