[llvm] [LoongArch][GlobalISel] Adding initial GlobalISel infrastructure (PR #116005)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 13 18:39:26 PST 2024
================
@@ -0,0 +1,49 @@
+//===-- LoongArchCallLowering.cpp - Call lowering ---------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+/// \file
+/// This file implements the lowering of LLVM calls to machine code calls for
+/// GlobalISel.
+//
+//===----------------------------------------------------------------------===//
+
+#include "LoongArchCallLowering.h"
+#include "LoongArchISelLowering.h"
+#include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
+
+using namespace llvm;
+
+LoongArchCallLowering::LoongArchCallLowering(const LoongArchTargetLowering &TLI)
+ : CallLowering(&TLI) {}
+
+bool LoongArchCallLowering::lowerReturn(MachineIRBuilder &MIRBuilder,
+ const Value *Val,
+ ArrayRef<Register> VRegs,
+ FunctionLoweringInfo &FLI) const {
+ MachineInstrBuilder Ret = MIRBuilder.buildInstrNoInsert(LoongArch::PseudoRET);
+
+ if (Val != nullptr)
+ return false;
----------------
zhaoqi5 wrote:
I have put the instruction creation right before to the insert. Thanks.
https://github.com/llvm/llvm-project/pull/116005
More information about the llvm-commits
mailing list