RISCVCallLowering.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //===-- RISCVCallLowering.cpp - Call lowering -------------------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. /// \file
  10. /// This file implements the lowering of LLVM calls to machine code calls for
  11. /// GlobalISel.
  12. //
  13. //===----------------------------------------------------------------------===//
  14. #include "RISCVCallLowering.h"
  15. #include "RISCVISelLowering.h"
  16. #include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
  17. using namespace llvm;
  18. RISCVCallLowering::RISCVCallLowering(const RISCVTargetLowering &TLI)
  19. : CallLowering(&TLI) {}
  20. bool RISCVCallLowering::lowerReturn(MachineIRBuilder &MIRBuilder,
  21. const Value *Val, ArrayRef<Register> VRegs,
  22. FunctionLoweringInfo &FLI) const {
  23. MachineInstrBuilder Ret = MIRBuilder.buildInstrNoInsert(RISCV::PseudoRET);
  24. if (Val != nullptr) {
  25. return false;
  26. }
  27. MIRBuilder.insertInstr(Ret);
  28. return true;
  29. }
  30. bool RISCVCallLowering::lowerFormalArguments(MachineIRBuilder &MIRBuilder,
  31. const Function &F,
  32. ArrayRef<ArrayRef<Register>> VRegs,
  33. FunctionLoweringInfo &FLI) const {
  34. if (F.arg_empty())
  35. return true;
  36. return false;
  37. }
  38. bool RISCVCallLowering::lowerCall(MachineIRBuilder &MIRBuilder,
  39. CallLoweringInfo &Info) const {
  40. return false;
  41. }