OpenASIP 2.2
Loading...
Searching...
No Matches
LLVMTCERISCVIntrinsicsLowering.hh
Go to the documentation of this file.
1/*
2 Copyright (C) 2022 Tampere University.
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this library; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18/**
19 * @file LLVMTCERISCVIntrinsicsLowering.hh
20 *
21 *
22 * Pass for lowering RISC-V intrinsics
23 *
24 * @author Kari Hepola 2022
25 * @note rating: red
26 */
27
28#ifndef LLVM_TCE_SCHEDULER_H
29#define LLVM_TCE_SCHEDULER_H
30
31#include <llvm/CodeGen/MachineFunctionPass.h>
32
33#include "Machine.hh"
34#include "BinaryEncoding.hh"
35#include "InstructionFormat.hh"
36#include "InterPassData.hh"
37
38namespace llvm {
39
40 extern "C" FunctionPass* createRISCVIntrinsicsPass(const char* target);
41
42 class LLVMTCERISCVIntrinsicsLowering : public MachineFunctionPass {
43 public:
44 static char ID;
47 virtual bool runOnMachineFunction(MachineFunction &MF);
48 private:
50 std::string findRegs(const std::string& s) const;
51 std::string findOperationName(const std::string& s) const;
52
53 std::vector<int> findRegIndexes(
54 const MachineBasicBlock::iterator& it) const;
55
57 const std::string& opName, const std::vector<int>& regIdxs) const;
58
59 virtual bool doInitialization(Module& m);
63
64 };
65}
66
67#endif
std::string findRegs(const std::string &s) const
std::string findOperationName(const std::string &s) const
std::vector< int > findRegIndexes(const MachineBasicBlock::iterator &it) const
int constructEncoding(const std::string &opName, const std::vector< int > &regIdxs) const
virtual bool runOnMachineFunction(MachineFunction &MF)
FunctionPass * createRISCVIntrinsicsPass(const char *)