[llvm-commits] [llvm] r170532 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/CodeGen/SelectionDAG/TargetLowering.cpp lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h

Duncan Sands baldrick at free.fr
Mon Dec 31 06:55:24 PST 2012


Hi Reed,

> ExpandIntegerOperand Op #2: 0xd33ed98: i32,i32 = sra_parts 0xd338628, 0xd338738,
> 0xd331180 [ID=0]
>
> Do not know how to expand this operator's operand!
> UNREACHABLE executed at
> /home/rkotler/workspace/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:2451!

based on this check in DAGTypeLegalizer::ExpandIntRes_Shift

   // Next check to see if the target supports this SHL_PARTS operation or if it
   // will custom expand it.
   EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), VT);
   TargetLowering::LegalizeAction Action = TLI.getOperationAction(PartsOpc, NVT);
   if ((Action == TargetLowering::Legal && TLI.isTypeLegal(NVT)) ||
       Action == TargetLowering::Custom) {

it looks like MIPS is claiming it knows how to custom expand an SRA_PARTS
operation with an illegal type, causing an SRA_PARTS node to be used here,
but in the end it doesn't custom expand it.  I think targets are allowed to
do this (say custom, but in the end change their mind) so I don't thing MIPS
is wrong as such.  That said, tweaking MIPS to only say Custom when it can
really handle it would probably resolve the problem.  Otherwise LegalizeTypes
needs to learn how to handle SRA_PARTS with illegal types.

Ciao, Duncan.



More information about the llvm-commits mailing list