Skip to content

Commit

Permalink
Fix bug in DAGCombiner for ARM that was trying to do a ShiftCombine o…
Browse files Browse the repository at this point in the history
…n illegal types (vector should be split first).

Added test case.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119749 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
tlattner committed Nov 18, 2010
1 parent 24d22d2 commit 9684a7c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Target/ARM/ARMISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4985,7 +4985,8 @@ static SDValue PerformShiftCombine(SDNode *N, SelectionDAG &DAG,
EVT VT = N->getValueType(0);

// Nothing to be done for scalar shifts.
if (! VT.isVector())
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
if (!VT.isVector() || !TLI.isTypeLegal(VT))
return SDValue();

assert(ST->hasNEON() && "unexpected vector shift");
Expand Down
8 changes: 8 additions & 0 deletions test/CodeGen/ARM/2010-11-17-DAGCombineShiftBug.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
; RUN: llc < %s -march=arm -mattr=+neon
define void @lshrIllegalType(<8 x i32>* %A) nounwind {
%tmp1 = load <8 x i32>* %A
%tmp2 = lshr <8 x i32> %tmp1, < i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
store <8 x i32> %tmp2, <8 x i32>* %A
ret void
}

0 comments on commit 9684a7c

Please sign in to comment.