[LLVMbugs] [Bug 7589] New: GVN incorrectly kills instructions

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jul 8 01:12:01 PDT 2010


           Summary: GVN incorrectly kills instructions
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: zhousheng00 at gmail.com
                CC: llvmbugs at cs.uiuc.edu

Here is input ll code:

; ModuleID = 'error.bc'
target datalayout =
target triple = "x86_64-unknown-linux-gnu"

define i16 @BlockCol([65 x i16]* %row2col, [64 x i16]* %colout, i4 %i) nounwind
  %row2col.addr1 = getelementptr [65 x i16]* %row2col, i64 0, i64 64 ; <i16*>
  %row2col.load = load i16* %row2col.addr1, align 1 ; <i16> [#uses=1]
  %dc_scaler = trunc i16 %row2col.load to i8      ; <i8> [#uses=0]
  br label %bb

bb:                                               ; preds = %entry
  %0 = zext i4 %i to i64                          ; <i64> [#uses=0]
  %.cast28 = zext i4 %i to i7                     ; <i7> [#uses=0]
  %.cast27 = zext i4 %i to i6                     ; <i6> [#uses=0]
  %.cast27.cast = zext i4 %i to i5                ; <i5> [#uses=1]
  %.cast26 = zext i4 %i to i5                     ; <i5> [#uses=1]
  %sum532 = or i5 %.cast26, -16                   ; <i5> [#uses=1]
  %sum5.cast = zext i5 %sum532 to i64             ; <i64> [#uses=1]
  %row2col.addr.1.26 = getelementptr [65 x i16]* %row2col, i64 0, i64
%sum5.cast ; <i16*> [#uses=1]
  %row2col.load.1.2 = load i16* %row2col.addr.1.26, align 1 ; <i16> [#uses=1]
  %sum1334 = or i5 %.cast27.cast, -16             ; <i5> [#uses=1]
  %sum13.cast31 = sext i5 %sum1334 to i6          ; <i6> [#uses=1]
  %sum13.cast = zext i6 %sum13.cast31 to i64      ; <i64> [#uses=1]
  %row2col.addr.1.614 = getelementptr [65 x i16]* %row2col, i64 0, i64
%sum13.cast ; <i16*> [#uses=1]
  %row2col.load.1.6 = load i16* %row2col.addr.1.614, align 1 ; <i16> [#uses=1]
  %.ret = add i16 %row2col.load.1.6, %row2col.load.1.2 ; <i16> [#uses=1]
  ret i16 %.ret

After GVN, the LoadInst "%row2col.load.1.6" is replaced with
"%row2col.load.1.2", however the address %sum5.cast and %sum13.cast are
obviously different.

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