mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
Teach getTargetVShiftNode about TargetConstant nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160234 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -9433,12 +9433,15 @@ static SDValue getTargetVShiftNode(unsigned Opc, DebugLoc dl, EVT VT,
|
||||
assert(ShAmt.getValueType() == MVT::i32 && "ShAmt is not i32");
|
||||
|
||||
if (isa<ConstantSDNode>(ShAmt)) {
|
||||
// Constant may be a TargetConstant. Use a regular constant.
|
||||
uint32_t ShiftAmt = cast<ConstantSDNode>(ShAmt)->getZExtValue();
|
||||
switch (Opc) {
|
||||
default: llvm_unreachable("Unknown target vector shift node");
|
||||
case X86ISD::VSHLI:
|
||||
case X86ISD::VSRLI:
|
||||
case X86ISD::VSRAI:
|
||||
return DAG.getNode(Opc, dl, VT, SrcOp, ShAmt);
|
||||
return DAG.getNode(Opc, dl, VT, SrcOp,
|
||||
DAG.getConstant(ShiftAmt, MVT::i32));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
; RUN: llc < %s -march=x86-64 -mcpu=corei7 -mattr=+avx2
|
||||
; make sure that we are not crashing.
|
||||
|
||||
define <16 x i32> @autogen_SD34717() {
|
||||
BB:
|
||||
%Shuff7 = shufflevector <16 x i32> zeroinitializer, <16 x i32> zeroinitializer, <16 x i32> <i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14, i32 16, i32 18, i32 undef, i32 22, i32 24, i32 26, i32 28, i32 30, i32 undef>
|
||||
%B9 = lshr <16 x i32> zeroinitializer, %Shuff7
|
||||
ret <16 x i32> %B9
|
||||
}
|
||||
Reference in New Issue
Block a user