File tree Expand file tree Collapse file tree 4 files changed +14
-17
lines changed Expand file tree Collapse file tree 4 files changed +14
-17
lines changed Original file line number Diff line number Diff line change 1010#define LLVM_ANALYSIS_TARGETLIBRARYINFO_H
1111
1212#include " llvm/ADT/DenseMap.h"
13- #include " llvm/CodeGen/ISDOpcodes.h"
1413#include " llvm/IR/Constants.h"
1514#include " llvm/IR/InstrTypes.h"
1615#include " llvm/IR/Module.h"
@@ -458,21 +457,6 @@ class TargetLibraryInfo {
458457 return Impl->CustomNames .find (F)->second ;
459458 }
460459
461- static unsigned getISDNode (Intrinsic::ID ID) {
462- unsigned Node;
463- switch (ID) {
464- case Intrinsic::exp:
465- Node = ISD::FEXP;
466- break ;
467- case Intrinsic::exp2:
468- Node = ISD::FEXP2;
469- break ;
470- default :
471- llvm_unreachable (" Intrinsic ID not supported yet" );
472- }
473- return Node;
474- }
475-
476460 static void initExtensionsForTriple (bool &ShouldExtI32Param,
477461 bool &ShouldExtI32Return,
478462 bool &ShouldSignExtI32Param,
Original file line number Diff line number Diff line change @@ -2123,6 +2123,9 @@ class TargetLoweringBase {
21232123 // / Get the ISD node that corresponds to the Instruction class opcode.
21242124 int InstructionOpcodeToISD (unsigned Opcode) const ;
21252125
2126+ // / Get the ISD node that corresponds to the Intrinsic ID.
2127+ int IntrinsicIDToISD (Intrinsic::ID ID) const ;
2128+
21262129 // / @}
21272130
21282131 // ===--------------------------------------------------------------------===//
Original file line number Diff line number Diff line change @@ -461,7 +461,7 @@ bool PreISelIntrinsicLowering::lowerIntrinsics(Module &M) const {
461461 if (!isa<ScalableVectorType>(Ty))
462462 return false ;
463463 const TargetLowering *TL = TM->getSubtargetImpl (F)->getTargetLowering ();
464- unsigned Op = TargetLibraryInfo::getISDNode (F.getIntrinsicID ());
464+ unsigned Op = TL-> IntrinsicIDToISD (F.getIntrinsicID ());
465465 if (!TL->isOperationExpand (Op, EVT::getEVT (Ty)))
466466 return false ;
467467 return lowerUnaryVectorIntrinsicAsLoop (M, CI);
Original file line number Diff line number Diff line change @@ -1841,6 +1841,16 @@ int TargetLoweringBase::InstructionOpcodeToISD(unsigned Opcode) const {
18411841 llvm_unreachable (" Unknown instruction type encountered!" );
18421842}
18431843
1844+ int TargetLoweringBase::IntrinsicIDToISD (Intrinsic::ID ID) const {
1845+ switch (ID) {
1846+ case Intrinsic::exp:
1847+ return ISD::FEXP;
1848+ case Intrinsic::exp2:
1849+ return ISD::FEXP2;
1850+ }
1851+ llvm_unreachable (" Unsupported Intrinsic ID encountered!" );
1852+ }
1853+
18441854Value *
18451855TargetLoweringBase::getDefaultSafeStackPointerLocation (IRBuilderBase &IRB,
18461856 bool UseTLS) const {
You can’t perform that action at this time.
0 commit comments