llvm-6502/test/CodeGen/X86/2008-12-02-IllegalResultType.ll
Duncan Sands 47d9dcc584 Fix PR3117: not all nodes being legalized. The
essential problem was that the DAG can contain
random unused nodes which were never analyzed.
When remapping a value of a node being processed,
such a node may become used and need to be analyzed;
however due to operands being transformed during
analysis the node may morph into a different one.
Users of the morphing node need to be updated, and
this wasn't happening.  While there I added a bunch
of documentation and sanity checks, so I (or some
other poor soul) won't have to scratch their head
over this stuff so long trying to remember how it
was all supposed to work next time some obscure
problem pops up!  The extra sanity checking exposed
a few places where invariants weren't being preserved,
so those are fixed too.  Since some of the sanity
checking is expensive, I added a flag to turn it
on.  It is also turned on when building with
ENABLE_EXPENSIVE_CHECKS=1.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60797 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 21:33:20 +00:00

38 lines
1.4 KiB
LLVM

; RUN: llvm-as < %s | llc
; PR3117
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i386-pc-linux-gnu"
@g_118 = external global i8 ; <i8*> [#uses=1]
@g_7 = external global i32 ; <i32*> [#uses=1]
define i32 @func_73(i32 %p_74) nounwind {
entry:
%0 = load i32* @g_7, align 4 ; <i32> [#uses=1]
%1 = or i8 0, 118 ; <i8> [#uses=1]
%2 = zext i8 %1 to i64 ; <i64> [#uses=1]
%3 = icmp ne i32 %0, 0 ; <i1> [#uses=1]
%4 = zext i1 %3 to i64 ; <i64> [#uses=1]
%5 = or i64 %4, -758998846 ; <i64> [#uses=3]
%6 = icmp sle i64 %2, %5 ; <i1> [#uses=1]
%7 = zext i1 %6 to i8 ; <i8> [#uses=1]
%8 = or i8 %7, 118 ; <i8> [#uses=1]
%9 = zext i8 %8 to i64 ; <i64> [#uses=1]
%10 = icmp sle i64 %9, 0 ; <i1> [#uses=1]
%11 = zext i1 %10 to i8 ; <i8> [#uses=1]
%12 = or i8 %11, 118 ; <i8> [#uses=1]
%13 = zext i8 %12 to i64 ; <i64> [#uses=1]
%14 = icmp sle i64 %13, %5 ; <i1> [#uses=1]
%15 = zext i1 %14 to i8 ; <i8> [#uses=1]
%16 = or i8 %15, 118 ; <i8> [#uses=1]
%17 = zext i8 %16 to i64 ; <i64> [#uses=1]
%18 = icmp sle i64 %17, 0 ; <i1> [#uses=1]
%19 = zext i1 %18 to i8 ; <i8> [#uses=1]
%20 = or i8 %19, 118 ; <i8> [#uses=1]
%21 = zext i8 %20 to i64 ; <i64> [#uses=1]
%22 = icmp sle i64 %21, %5 ; <i1> [#uses=1]
%23 = zext i1 %22 to i8 ; <i8> [#uses=1]
%24 = or i8 %23, 118 ; <i8> [#uses=1]
store i8 %24, i8* @g_118, align 1
ret i32 undef
}