[llvm-commits] [llvm] r92797 - in /llvm/trunk: lib/CodeGen/SelectionDAG/DAGCombiner.cpp test/CodeGen/X86/2010-01-05-ZExt-Shl.ll
Bill Wendling
isanbard at gmail.com
Tue Jan 5 14:39:10 PST 2010
Author: void
Date: Tue Jan 5 16:39:10 2010
New Revision: 92797
URL: http://llvm.org/viewvc/llvm-project?rev=92797&view=rev
Log:
Don't assign the shift the same type as the variable being shifted. This could
result in illegal types for the SHL operator.
Added:
llvm/trunk/test/CodeGen/X86/2010-01-05-ZExt-Shl.ll
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=92797&r1=92796&r2=92797&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue Jan 5 16:39:10 2010
@@ -3322,7 +3322,9 @@
DebugLoc dl = N->getDebugLoc();
return DAG.getNode(N0.getOpcode(), dl, VT,
DAG.getNode(ISD::ZERO_EXTEND, dl, VT, N0.getOperand(0)),
- DAG.getNode(ISD::ZERO_EXTEND, dl, VT, N0.getOperand(1)));
+ DAG.getNode(ISD::ZERO_EXTEND, dl,
+ N0.getOperand(1).getValueType(),
+ N0.getOperand(1)));
}
return SDValue();
Added: llvm/trunk/test/CodeGen/X86/2010-01-05-ZExt-Shl.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2010-01-05-ZExt-Shl.ll?rev=92797&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2010-01-05-ZExt-Shl.ll (added)
+++ llvm/trunk/test/CodeGen/X86/2010-01-05-ZExt-Shl.ll Tue Jan 5 16:39:10 2010
@@ -0,0 +1,15 @@
+; RUN: llc < %s -march=x86-64
+; <rdar://problem/7499313>
+target triple = "i686-apple-darwin8"
+
+declare void @func2(i16 zeroext)
+
+define void @func1() nounwind {
+entry:
+ %t1 = icmp ne i8 undef, 0
+ %t2 = icmp eq i8 undef, 14
+ %t3 = and i1 %t1, %t2
+ %t4 = select i1 %t3, i16 0, i16 128
+ call void @func2(i16 zeroext %t4) nounwind
+ ret void
+}
More information about the llvm-commits
mailing list