Index: lib/Analysis/TargetLibraryInfo.cpp =================================================================== --- lib/Analysis/TargetLibraryInfo.cpp +++ lib/Analysis/TargetLibraryInfo.cpp @@ -550,6 +550,12 @@ if (T.isNVPTX()) { TLI.disableAllFunctions(); TLI.setAvailable(LibFunc_nvvm_reflect); + TLI.setAvailable(LibFunc_pow); + TLI.setAvailable(LibFunc_pow_finite); + TLI.setAvailable(LibFunc_powf); + TLI.setAvailable(LibFunc_powf_finite); + TLI.setAvailable(LibFunc_powl); + TLI.setAvailable(LibFunc_powl_finite); } else { TLI.setUnavailable(LibFunc_nvvm_reflect); } Index: lib/Target/NVPTX/NVPTXISelLowering.cpp =================================================================== --- lib/Target/NVPTX/NVPTXISelLowering.cpp +++ lib/Target/NVPTX/NVPTXISelLowering.cpp @@ -583,6 +583,14 @@ // No FEXP2, FLOG2. The PTX ex2 and log2 functions are always approximate. // No FPOW or FREM in PTX. + setOperationAction(ISD::FPOW, MVT::f32, Expand); + setOperationAction(ISD::FPOW, MVT::f64, Expand); + setOperationAction(ISD::FPOW, MVT::f80, Expand); + + setOperationAction(ISD::FSIN, MVT::f32, Expand); + setOperationAction(ISD::FSIN, MVT::f64, Expand); + setOperationAction(ISD::FSIN, MVT::f80, Expand); + // Now deduce the information based on the above mentioned // actions computeRegisterProperties(STI.getRegisterInfo());