[llvm-commits] [llvm] r141074 - /llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp
Duncan Sands
baldrick at free.fr
Tue Oct 4 03:16:34 PDT 2011
Hi Nadav,
> Operations should be custom lowered only if their type is legal.
I think it is also wrong (though possibly harmless) to set operations to legal,
expand etc when the type is not legal. So I suggest you test the legality of
the vector type at the start of the loop and just continue to the next iteration
if it is not legal.
Ciao, Duncan.
>
> Test: CellSPU/v2i32.ll when running with -promote-elements
>
>
> Modified:
> llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp
>
> Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=141074&r1=141073&r2=141074&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original)
> +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Tue Oct 4 05:03:32 2011
> @@ -423,12 +423,14 @@
>
> // Custom lower build_vector, constant pool spills, insert and
> // extract vector elements:
> - setOperationAction(ISD::BUILD_VECTOR, VT, Custom);
> - setOperationAction(ISD::ConstantPool, VT, Custom);
> - setOperationAction(ISD::SCALAR_TO_VECTOR, VT, Custom);
> - setOperationAction(ISD::EXTRACT_VECTOR_ELT, VT, Custom);
> - setOperationAction(ISD::INSERT_VECTOR_ELT, VT, Custom);
> - setOperationAction(ISD::VECTOR_SHUFFLE, VT, Custom);
> + if (isTypeLegal(VT)) {
> + setOperationAction(ISD::BUILD_VECTOR, VT, Custom);
> + setOperationAction(ISD::ConstantPool, VT, Custom);
> + setOperationAction(ISD::SCALAR_TO_VECTOR, VT, Custom);
> + setOperationAction(ISD::EXTRACT_VECTOR_ELT, VT, Custom);
> + setOperationAction(ISD::INSERT_VECTOR_ELT, VT, Custom);
> + setOperationAction(ISD::VECTOR_SHUFFLE, VT, Custom);
> + }
> }
>
> setOperationAction(ISD::AND, MVT::v16i8, Custom);
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list