diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp index a0f72568ad1..bd74a09a876 100644 --- a/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/lib/Target/PowerPC/PPCISelLowering.cpp @@ -453,6 +453,8 @@ PPCTargetLowering::PPCTargetLowering(PPCTargetMachine &TM) setOperationAction(ISD::EXTRACT_VECTOR_ELT, VT, Expand); setOperationAction(ISD::INSERT_VECTOR_ELT, VT, Expand); setOperationAction(ISD::BUILD_VECTOR, VT, Expand); + setOperationAction(ISD::MULHU, VT, Expand); + setOperationAction(ISD::MULHS, VT, Expand); setOperationAction(ISD::UMUL_LOHI, VT, Expand); setOperationAction(ISD::SMUL_LOHI, VT, Expand); setOperationAction(ISD::UDIVREM, VT, Expand); diff --git a/test/CodeGen/PowerPC/vec_urem_const.ll b/test/CodeGen/PowerPC/vec_urem_const.ll new file mode 100644 index 00000000000..a562c3bb359 --- /dev/null +++ b/test/CodeGen/PowerPC/vec_urem_const.ll @@ -0,0 +1,10 @@ +; RUN: llc -mcpu=pwr6 -mattr=+altivec < %s + +; Common code used to replace the urem by a mulhu, and compilation would +; then crash since mulhu isn't supported on vector types. + +define <4 x i32> @test(<4 x i32> %x) { +entry: + %0 = urem <4 x i32> %x, + ret <4 x i32> %0 +}