|
31 | 31 | #include "llvm/CodeGen/ISDOpcodes.h" |
32 | 32 | #include "llvm/CodeGen/LowLevelTypeUtils.h" |
33 | 33 | #include "llvm/CodeGen/MachineRegisterInfo.h" |
34 | | -#include "llvm/CodeGen/RuntimeLibcalls.h" |
| 34 | +#include "llvm/CodeGen/RuntimeLibcallUtil.h" |
35 | 35 | #include "llvm/CodeGen/SelectionDAG.h" |
36 | 36 | #include "llvm/CodeGen/SelectionDAGNodes.h" |
37 | 37 | #include "llvm/CodeGen/TargetCallingConv.h" |
|
45 | 45 | #include "llvm/IR/InlineAsm.h" |
46 | 46 | #include "llvm/IR/Instruction.h" |
47 | 47 | #include "llvm/IR/Instructions.h" |
| 48 | +#include "llvm/IR/RuntimeLibcalls.h" |
48 | 49 | #include "llvm/IR/Type.h" |
49 | 50 | #include "llvm/Support/Alignment.h" |
50 | 51 | #include "llvm/Support/AtomicOrdering.h" |
@@ -3414,44 +3415,44 @@ class TargetLoweringBase { |
3414 | 3415 | return nullptr; |
3415 | 3416 | } |
3416 | 3417 |
|
3417 | | - //===--------------------------------------------------------------------===// |
3418 | | - // Runtime Library hooks |
3419 | | - // |
3420 | | - |
3421 | 3418 | /// Rename the default libcall routine name for the specified libcall. |
3422 | 3419 | void setLibcallName(RTLIB::Libcall Call, const char *Name) { |
3423 | | - LibcallRoutineNames[Call] = Name; |
| 3420 | + Libcalls.setLibcallName(Call, Name); |
3424 | 3421 | } |
| 3422 | + |
3425 | 3423 | void setLibcallName(ArrayRef<RTLIB::Libcall> Calls, const char *Name) { |
3426 | | - for (auto Call : Calls) |
3427 | | - setLibcallName(Call, Name); |
| 3424 | + Libcalls.setLibcallName(Calls, Name); |
3428 | 3425 | } |
3429 | 3426 |
|
3430 | 3427 | /// Get the libcall routine name for the specified libcall. |
3431 | 3428 | const char *getLibcallName(RTLIB::Libcall Call) const { |
3432 | | - return LibcallRoutineNames[Call]; |
| 3429 | + return Libcalls.getLibcallName(Call); |
3433 | 3430 | } |
3434 | 3431 |
|
3435 | 3432 | /// Override the default CondCode to be used to test the result of the |
3436 | 3433 | /// comparison libcall against zero. |
| 3434 | + /// FIXME: This can't be merged with 'RuntimeLibcallsInfo' because of the ISD. |
3437 | 3435 | void setCmpLibcallCC(RTLIB::Libcall Call, ISD::CondCode CC) { |
3438 | 3436 | CmpLibcallCCs[Call] = CC; |
3439 | 3437 | } |
3440 | 3438 |
|
| 3439 | + |
3441 | 3440 | /// Get the CondCode that's to be used to test the result of the comparison |
3442 | 3441 | /// libcall against zero. |
| 3442 | + /// FIXME: This can't be merged with 'RuntimeLibcallsInfo' because of the ISD. |
3443 | 3443 | ISD::CondCode getCmpLibcallCC(RTLIB::Libcall Call) const { |
3444 | 3444 | return CmpLibcallCCs[Call]; |
3445 | 3445 | } |
3446 | 3446 |
|
| 3447 | + |
3447 | 3448 | /// Set the CallingConv that should be used for the specified libcall. |
3448 | 3449 | void setLibcallCallingConv(RTLIB::Libcall Call, CallingConv::ID CC) { |
3449 | | - LibcallCallingConvs[Call] = CC; |
| 3450 | + Libcalls.setLibcallCallingConv(Call, CC); |
3450 | 3451 | } |
3451 | 3452 |
|
3452 | 3453 | /// Get the CallingConv that should be used for the specified libcall. |
3453 | 3454 | CallingConv::ID getLibcallCallingConv(RTLIB::Libcall Call) const { |
3454 | | - return LibcallCallingConvs[Call]; |
| 3455 | + return Libcalls.getLibcallCallingConv(Call); |
3455 | 3456 | } |
3456 | 3457 |
|
3457 | 3458 | /// Execute target specific actions to finalize target lowering. |
@@ -3630,19 +3631,13 @@ class TargetLoweringBase { |
3630 | 3631 | std::map<std::pair<unsigned, MVT::SimpleValueType>, MVT::SimpleValueType> |
3631 | 3632 | PromoteToType; |
3632 | 3633 |
|
3633 | | - /// Stores the name each libcall. |
3634 | | - const char *LibcallRoutineNames[RTLIB::UNKNOWN_LIBCALL + 1]; |
| 3634 | + /// The list of libcalls that the target will use. |
| 3635 | + RTLIB::RuntimeLibcallsInfo Libcalls; |
3635 | 3636 |
|
3636 | 3637 | /// The ISD::CondCode that should be used to test the result of each of the |
3637 | 3638 | /// comparison libcall against zero. |
3638 | 3639 | ISD::CondCode CmpLibcallCCs[RTLIB::UNKNOWN_LIBCALL]; |
3639 | 3640 |
|
3640 | | - /// Stores the CallingConv that should be used for each libcall. |
3641 | | - CallingConv::ID LibcallCallingConvs[RTLIB::UNKNOWN_LIBCALL]; |
3642 | | - |
3643 | | - /// Set default libcall names and calling conventions. |
3644 | | - void InitLibcalls(const Triple &TT); |
3645 | | - |
3646 | 3641 | /// The bits of IndexedModeActions used to store the legalisation actions |
3647 | 3642 | /// We store the data as | ML | MS | L | S | each taking 4 bits. |
3648 | 3643 | enum IndexedModeActionsBits { |
|
0 commit comments