Paste: llvm crash case

Author: kssreeram
Mode: text
Date: Sun, 18 Jul 2010 19:12:00
Plain Text |
; ModuleID = 'clay'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-apple-darwin10"

%Circle = type { double }
%Shape = type { i32, %"Union[Square, Circle]" }
%Square = type { i32 }
%"Union[Square, Circle]" = type union { %Square, %Circle }

define i32 @main() nounwind {
init:
  %0 = alloca i32, align 4                        ; <i32*> [#uses=2]
  %1 = alloca %Shape, align 8                     ; <%Shape*> [#uses=1]
  %2 = alloca %Square, align 8                    ; <%Square*> [#uses=2]
  %3 = alloca i32*, align 8                       ; <i32**> [#uses=2]
  call fastcc void @clay_recordFields(%Square* %2, i32** %3)
  %4 = load i32** %3                              ; <i32*> [#uses=1]
  store i32 1, i32* %4
  call fastcc void @clay_Shape(%Square* %2, %Shape* %1)
  call fastcc void @clay_Int328(i64 16, i32* %0)
  %5 = load i32* %0                               ; <i32> [#uses=1]
  ret i32 %5
}

define internal fastcc void @clay_recordFields(%Square* %a, i32** nocapture) nounwind {
init:
  %1 = alloca i32*, align 8                       ; <i32**> [#uses=2]
  call fastcc void @clay_recordFields2(%Square* %a, i32** %1)
  %2 = load i32** %1                              ; <i32*> [#uses=1]
  store i32* %2, i32** %0
  ret void
}

define internal fastcc void @clay_recordFields2(%Square* %a, i32** nocapture) nounwind {
init:
  %1 = getelementptr %Square* %a, i64 0, i32 0    ; <i32*> [#uses=1]
  store i32* %1, i32** %0
  ret void
}

define internal fastcc void @clay_Shape(%Square* nocapture %x, %Shape* %returned) nounwind {
init:
  %0 = alloca i32*, align 8                       ; <i32**> [#uses=2]
  %1 = alloca %Square*, align 8                   ; <%Square**> [#uses=2]
  %2 = alloca %"Union[Square, Circle]"*, align 8  ; <%"Union[Square, Circle]"**> [#uses=2]
  call fastcc void @clay_fieldRef(%Shape* %returned, i32** %0)
  %3 = load i32** %0                              ; <i32*> [#uses=1]
  store i32 0, i32* %3
  call fastcc void @clay_fieldRef3(%Shape* %returned, %"Union[Square, Circle]"** %2)
  %4 = load %"Union[Square, Circle]"** %2         ; <%"Union[Square, Circle]"*> [#uses=1]
  call fastcc void @clay_staticIndex(%"Union[Square, Circle]"* %4, %Square** %1)
  %5 = load %Square** %1                          ; <%Square*> [#uses=1]
  %x.idx = getelementptr %Square* %x, i64 0, i32 0 ; <i32*> [#uses=1]
  %x.idx.val = load i32* %x.idx                   ; <i32> [#uses=1]
  call fastcc void @clay_move(i32 %x.idx.val, %Square* %5)
  ret void
}

define internal fastcc void @clay_fieldRef(%Shape* %x, i32** nocapture) nounwind {
init:
  %1 = getelementptr %Shape* %x, i64 0, i32 0     ; <i32*> [#uses=1]
  store i32* %1, i32** %0
  ret void
}

define internal fastcc void @clay_fieldRef3(%Shape* %x, %"Union[Square, Circle]"** nocapture) nounwind {
init:
  %1 = getelementptr %Shape* %x, i64 0, i32 1     ; <%"Union[Square, Circle]"*> [#uses=1]
  store %"Union[Square, Circle]"* %1, %"Union[Square, Circle]"** %0
  ret void
}

define internal fastcc void @clay_staticIndex(%"Union[Square, Circle]"* %x, %Square** nocapture) nounwind {
init:
  %1 = alloca %Square*, align 8                   ; <%Square**> [#uses=2]
  %2 = alloca %Square*, align 8                   ; <%Square**> [#uses=2]
  call fastcc void @"clay_Pointer[Square]"(%"Union[Square, Circle]"* %x, %Square** %2)
  %.val1 = load %Square** %2                      ; <%Square*> [#uses=1]
  call fastcc void @clay_dereference(%Square* %.val1, %Square** %1)
  %3 = load %Square** %1                          ; <%Square*> [#uses=1]
  store %Square* %3, %Square** %0
  ret void
}

define internal fastcc void @"clay_Pointer[Square]"(%"Union[Square, Circle]"* %a.val, %Square** nocapture) nounwind {
init:
  %1 = getelementptr inbounds %"Union[Square, Circle]"* %a.val, i64 0, i32 0 ; <%Square*> [#uses=1]
  store %Square* %1, %Square** %0
  ret void
}

define internal fastcc void @clay_dereference(%Square* %p.val, %Square** nocapture) nounwind {
init:
  store %Square* %p.val, %Square** %0
  ret void
}

define internal fastcc void @clay_move(i32 %src.0.0.val, %Square* nocapture %returned) nounwind {
init:
  tail call fastcc void @clay_moveRecordFields(%Square* %returned, i32 %src.0.0.val)
  ret void
}

define internal fastcc void @clay_moveRecordFields(%Square* nocapture %dest, i32 %src.0.0.val) nounwind {
init:
  %0 = getelementptr %Square* %dest, i64 0, i32 0 ; <i32*> [#uses=1]
  tail call fastcc void @clay_move4(i32 %src.0.0.val, i32* %0)
  ret void
}

define internal fastcc void @clay_move4(i32 %a.val, i32* nocapture %returned) nounwind {
init:
  store i32 %a.val, i32* %returned
  ret void
}

define internal fastcc void @clay_Int328(i64 %src.val, i32* nocapture) nounwind {
init:
  %1 = trunc i64 %src.val to i32                  ; <i32> [#uses=1]
  store i32 %1, i32* %0
  ret void
}

New Annotation

Summary:
Author:
Mode:
Body: