[LLVMdev] SoftenSetCCOpernads in LegalizeFloatTypes.cpp

Sanjiv Gupta sanjiv.gupta at microchip.com
Tue Sep 29 04:34:30 PDT 2009


While generating a libcall from floating point comparison, it always 
assumes that the return type of those libcalls is i32.
Why not allow Targets to provide the correct return type?

EVT RetVT = MVT::i32;       // <-- here


  SDValue Ops[2] = { LHSInt, RHSInt };
  NewLHS = MakeLibCall(LC1, RetVT, Ops, 2, false/*sign irrelevant*/, dl);
  NewRHS = DAG.getConstant(0, RetVT);
  CCCode = TLI.getCmpLibcallCC(LC1);


I suggest to have a hook TLI.getCmpLibcallRT() on the lines of 
TLI.getCmpLibcallCC()

Does that sound okay?

- Sanjiv




More information about the llvm-dev mailing list