[llvm-commits] [llvm] r86462 - in /llvm/trunk: test/CodeGen/MSP430/2009-11-08-InvalidResNo.ll utils/TableGen/DAGISelEmitter.cpp
Anton Korobeynikov
asl at math.spbu.ru
Sun Nov 8 04:14:55 PST 2009
Author: asl
Date: Sun Nov 8 06:14:54 2009
New Revision: 86462
URL: http://llvm.org/viewvc/llvm-project?rev=86462&view=rev
Log:
It is invalid to infer the value type from the result #0 of the node
since the instruction might use the other result of different type.
Added:
llvm/trunk/test/CodeGen/MSP430/2009-11-08-InvalidResNo.ll
Modified:
llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
Added: llvm/trunk/test/CodeGen/MSP430/2009-11-08-InvalidResNo.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/MSP430/2009-11-08-InvalidResNo.ll?rev=86462&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/MSP430/2009-11-08-InvalidResNo.ll (added)
+++ llvm/trunk/test/CodeGen/MSP430/2009-11-08-InvalidResNo.ll Sun Nov 8 06:14:54 2009
@@ -0,0 +1,64 @@
+; RUN: llc < %s
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"
+target triple = "msp430-elf"
+
+%struct.httpd_fs_file = type { i8*, i16 }
+%struct.psock = type { %struct.pt, %struct.pt, i8*, i8*, i8*, i16, i16, %struct.httpd_fs_file, i16, i8, i8 }
+%struct.pt = type { i16 }
+
+ at foo = external global i8*
+
+define signext i8 @psock_readto(%struct.psock* nocapture %psock, i8 zeroext %c) nounwind {
+entry:
+ switch i16 undef, label %sw.epilog [
+ i16 0, label %sw.bb
+ i16 283, label %if.else.i
+ ]
+
+sw.bb: ; preds = %entry
+ br label %do.body
+
+do.body: ; preds = %while.cond36.i, %while.end.i, %sw.bb
+ br label %while.cond.i
+
+if.else.i: ; preds = %entry
+ br i1 undef, label %psock_newdata.exit, label %if.else11.i
+
+if.else11.i: ; preds = %if.else.i
+ ret i8 0
+
+psock_newdata.exit: ; preds = %if.else.i
+ ret i8 0
+
+while.cond.i: ; preds = %while.body.i, %do.body
+ br i1 undef, label %while.end.i, label %while.body.i
+
+while.body.i: ; preds = %while.cond.i
+ br i1 undef, label %do.end41, label %while.cond.i
+
+while.end.i: ; preds = %while.cond.i
+ br i1 undef, label %do.body, label %while.cond36.i.preheader
+
+while.cond36.i.preheader: ; preds = %while.end.i
+ br label %while.cond36.i
+
+while.cond36.i: ; preds = %while.body41.i, %while.cond36.i.preheader
+ br i1 undef, label %do.body, label %while.body41.i
+
+while.body41.i: ; preds = %while.cond36.i
+ %tmp43.i = load i8** @foo ; <i8*> [#uses=2]
+ %tmp44.i = load i8* %tmp43.i ; <i8> [#uses=1]
+ %ptrincdec50.i = getelementptr inbounds i8* %tmp43.i, i16 1 ; <i8*> [#uses=1]
+ store i8* %ptrincdec50.i, i8** @foo
+ %cmp55.i = icmp eq i8 %tmp44.i, %c ; <i1> [#uses=1]
+ br i1 %cmp55.i, label %do.end41, label %while.cond36.i
+
+do.end41: ; preds = %while.body41.i, %while.body.i
+ br i1 undef, label %if.then46, label %sw.epilog
+
+if.then46: ; preds = %do.end41
+ ret i8 0
+
+sw.epilog: ; preds = %do.end41, %entry
+ ret i8 2
+}
Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=86462&r1=86461&r2=86462&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Sun Nov 8 06:14:54 2009
@@ -1359,7 +1359,7 @@
Pat->setTypes(Other->getExtTypes());
// The top level node type is checked outside of the select function.
if (!isRoot)
- emitCheck(Prefix + ".getNode()->getValueType(0) == " +
+ emitCheck(Prefix + ".getValueType() == " +
getName(Pat->getTypeNum(0)));
return true;
}
More information about the llvm-commits
mailing list