From 47d9dcc584cdb7fd645ca1d5c2a0ce363570aeb7 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Tue, 9 Dec 2008 21:33:20 +0000 Subject: 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 --- test/CodeGen/X86/2008-12-02-IllegalResultType.ll | 37 ++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 test/CodeGen/X86/2008-12-02-IllegalResultType.ll (limited to 'test/CodeGen/X86/2008-12-02-IllegalResultType.ll') diff --git a/test/CodeGen/X86/2008-12-02-IllegalResultType.ll b/test/CodeGen/X86/2008-12-02-IllegalResultType.ll new file mode 100644 index 0000000..01e0f7e --- /dev/null +++ b/test/CodeGen/X86/2008-12-02-IllegalResultType.ll @@ -0,0 +1,37 @@ +; 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 ; [#uses=1] +@g_7 = external global i32 ; [#uses=1] + +define i32 @func_73(i32 %p_74) nounwind { +entry: + %0 = load i32* @g_7, align 4 ; [#uses=1] + %1 = or i8 0, 118 ; [#uses=1] + %2 = zext i8 %1 to i64 ; [#uses=1] + %3 = icmp ne i32 %0, 0 ; [#uses=1] + %4 = zext i1 %3 to i64 ; [#uses=1] + %5 = or i64 %4, -758998846 ; [#uses=3] + %6 = icmp sle i64 %2, %5 ; [#uses=1] + %7 = zext i1 %6 to i8 ; [#uses=1] + %8 = or i8 %7, 118 ; [#uses=1] + %9 = zext i8 %8 to i64 ; [#uses=1] + %10 = icmp sle i64 %9, 0 ; [#uses=1] + %11 = zext i1 %10 to i8 ; [#uses=1] + %12 = or i8 %11, 118 ; [#uses=1] + %13 = zext i8 %12 to i64 ; [#uses=1] + %14 = icmp sle i64 %13, %5 ; [#uses=1] + %15 = zext i1 %14 to i8 ; [#uses=1] + %16 = or i8 %15, 118 ; [#uses=1] + %17 = zext i8 %16 to i64 ; [#uses=1] + %18 = icmp sle i64 %17, 0 ; [#uses=1] + %19 = zext i1 %18 to i8 ; [#uses=1] + %20 = or i8 %19, 118 ; [#uses=1] + %21 = zext i8 %20 to i64 ; [#uses=1] + %22 = icmp sle i64 %21, %5 ; [#uses=1] + %23 = zext i1 %22 to i8 ; [#uses=1] + %24 = or i8 %23, 118 ; [#uses=1] + store i8 %24, i8* @g_118, align 1 + ret i32 undef +} -- cgit v1.1