[LLVMdev] getConvertAction/setConvertAction

Villmow, Micah Micah.Villmow at amd.com
Fri Mar 19 12:23:28 PDT 2010


Is there anywhere in the codebase that actually uses the ConvertAction to determine how conversion functions are lowered?

In SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op)

...
  case ISD::SINT_TO_FP:
  case ISD::UINT_TO_FP:
  case ISD::EXTRACT_VECTOR_ELT:
    Action = TLI.getOperationAction(Node->getOpcode(),
                                    Node->getOperand(0).getValueType());

This seems incorrect as SINT_TO_FP should be querying the convert action, and not the Operation action.

i.e. it should be:
  case ISD::SINT_TO_FP:
  case ISD::UINT_TO_FP:
  case ISD::FP_TO_SINT:
  case ISD::FP_TO_UINT:
    Action = TLI.getConvertAction(Node->getValueType(),
                                    Node->getOperand(0).getValueType());
      break;
  case ISD::EXTRACT_VECTOR_ELT:
    Action = TLI.getOperationAction(Node->getOpcode(),
                                    Node->getOperand(0).getValueType());



Is this assumption correct? I cannot get LLVM to expand fp64 -> i64 nodes into either to a custom lowered function or expanded to a software function call.


Is getConvertAction being removed? If so, how should I handle this in the backend?

Thanks,
Micah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100319/c79c7f71/attachment.html>


More information about the llvm-dev mailing list