[llvm] [Exegesis][RISCV] Add RISCV support for llvm-exegesis (PR #89047)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 10:34:58 PDT 2024


dtcxzyw wrote:

```
: && /usr/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -w -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/data/llvm-build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libLLVMExegesisRISCV.so.19.0git -o lib/libLLVMExegesisRISCV.so.19.0git tools/llvm-exegesis/lib/RISCV/CMakeFiles/obj.LLVMExegesisRISCV.dir/Target.cpp.o tools/llvm-exegesis/lib/RISCV/CMakeFiles/obj.LLVMExegesisRISCV.dir/RISCVCounters.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/data/llvm-build/lib:"  lib/libLLVMRISCVCodeGen.so.19.0git  lib/libLLVMRISCVAsmParser.so.19.0git  lib/libLLVMRISCVDisassembler.so.19.0git  lib/libLLVMExegesis.so.19.0git  lib/libLLVMRISCVDesc.so.19.0git  lib/libLLVMRISCVInfo.so.19.0git  lib/libLLVMCore.so.19.0git  lib/libLLVMSupport.so.19.0git  -Wl,-rpath-link,/data/llvm-build/lib && :
/usr/bin/ld: tools/llvm-exegesis/lib/RISCV/CMakeFiles/obj.LLVMExegesisRISCV.dir/Target.cpp.o: in function `llvm::exegesis::(anonymous namespace)::ExegesisRISCVTarget::decrementLoopCounterAndJump(llvm::MachineBasicBlock&, llvm::MachineBasicBlock&, llvm::MCInstrInfo const&, unsigned int) const':
Target.cpp:(.text._ZNK4llvm8exegesis12_GLOBAL__N_119ExegesisRISCVTarget27decrementLoopCounterAndJumpERNS_17MachineBasicBlockES4_RKNS_11MCInstrInfoEj+0xaa): undefined reference to `llvm::MachineFunction::CreateMachineInstr(llvm::MCInstrDesc const&, llvm::DebugLoc, bool)'
/usr/bin/ld: Target.cpp:(.text._ZNK4llvm8exegesis12_GLOBAL__N_119ExegesisRISCVTarget27decrementLoopCounterAndJumpERNS_17MachineBasicBlockES4_RKNS_11MCInstrInfoEj+0x116): undefined reference to `llvm::ilist_traits<llvm::MachineInstr>::addNodeToList(llvm::MachineInstr*)'
/usr/bin/ld: Target.cpp:(.text._ZNK4llvm8exegesis12_GLOBAL__N_119ExegesisRISCVTarget27decrementLoopCounterAndJumpERNS_17MachineBasicBlockES4_RKNS_11MCInstrInfoEj+0x2c8): undefined reference to `llvm::MachineInstr::setPCSections(llvm::MachineFunction&, llvm::MDNode*)'
/usr/bin/ld: Target.cpp:(.text._ZNK4llvm8exegesis12_GLOBAL__N_119ExegesisRISCVTarget27decrementLoopCounterAndJumpERNS_17MachineBasicBlockES4_RKNS_11MCInstrInfoEj+0x2d4): undefined reference to `llvm::MachineInstr::setMMRAMetadata(llvm::MachineFunction&, llvm::MDNode*)'
/usr/bin/ld: Target.cpp:(.text._ZNK4llvm8exegesis12_GLOBAL__N_119ExegesisRISCVTarget27decrementLoopCounterAndJumpERNS_17MachineBasicBlockES4_RKNS_11MCInstrInfoEj+0x2ec): undefined reference to `llvm::MachineInstr::addOperand(llvm::MachineFunction&, llvm::MachineOperand const&)'
/usr/bin/ld: Target.cpp:(.text._ZNK4llvm8exegesis12_GLOBAL__N_119ExegesisRISCVTarget27decrementLoopCounterAndJumpERNS_17MachineBasicBlockES4_RKNS_11MCInstrInfoEj+0x300): undefined reference to `llvm::MachineInstr::addOperand(llvm::MachineFunction&, llvm::MachineOperand const&)'
/usr/bin/ld: Target.cpp:(.text._ZNK4llvm8exegesis12_GLOBAL__N_119ExegesisRISCVTarget27decrementLoopCounterAndJumpERNS_17MachineBasicBlockES4_RKNS_11MCInstrInfoEj+0x31e): undefined reference to `llvm::MachineInstr::addOperand(llvm::MachineFunction&, llvm::MachineOperand const&)'
/usr/bin/ld: Target.cpp:(.text._ZNK4llvm8exegesis12_GLOBAL__N_119ExegesisRISCVTarget27decrementLoopCounterAndJumpERNS_17MachineBasicBlockES4_RKNS_11MCInstrInfoEj+0x3b0): undefined reference to `llvm::MachineFunction::CreateMachineInstr(llvm::MCInstrDesc const&, llvm::DebugLoc, bool)'
/usr/bin/ld: Target.cpp:(.text._ZNK4llvm8exegesis12_GLOBAL__N_119ExegesisRISCVTarget27decrementLoopCounterAndJumpERNS_17MachineBasicBlockES4_RKNS_11MCInstrInfoEj+0x418): undefined reference to `llvm::ilist_traits<llvm::MachineInstr>::addNodeToList(llvm::MachineInstr*)'
/usr/bin/ld: Target.cpp:(.text._ZNK4llvm8exegesis12_GLOBAL__N_119ExegesisRISCVTarget27decrementLoopCounterAndJumpERNS_17MachineBasicBlockES4_RKNS_11MCInstrInfoEj+0x5ca): undefined reference to `llvm::MachineInstr::setPCSections(llvm::MachineFunction&, llvm::MDNode*)'
/usr/bin/ld: Target.cpp:(.text._ZNK4llvm8exegesis12_GLOBAL__N_119ExegesisRISCVTarget27decrementLoopCounterAndJumpERNS_17MachineBasicBlockES4_RKNS_11MCInstrInfoEj+0x5d6): undefined reference to `llvm::MachineInstr::setMMRAMetadata(llvm::MachineFunction&, llvm::MDNode*)'
/usr/bin/ld: Target.cpp:(.text._ZNK4llvm8exegesis12_GLOBAL__N_119ExegesisRISCVTarget27decrementLoopCounterAndJumpERNS_17MachineBasicBlockES4_RKNS_11MCInstrInfoEj+0x5ea): undefined reference to `llvm::MachineInstr::addOperand(llvm::MachineFunction&, llvm::MachineOperand const&)'
/usr/bin/ld: Target.cpp:(.text._ZNK4llvm8exegesis12_GLOBAL__N_119ExegesisRISCVTarget27decrementLoopCounterAndJumpERNS_17MachineBasicBlockES4_RKNS_11MCInstrInfoEj+0x602): undefined reference to `llvm::MachineInstr::addOperand(llvm::MachineFunction&, llvm::MachineOperand const&)'
/usr/bin/ld: Target.cpp:(.text._ZNK4llvm8exegesis12_GLOBAL__N_119ExegesisRISCVTarget27decrementLoopCounterAndJumpERNS_17MachineBasicBlockES4_RKNS_11MCInstrInfoEj+0x61e): undefined reference to `llvm::MachineInstr::addOperand(llvm::MachineFunction&, llvm::MachineOperand const&)'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
```

@AnastasiyaChernikova Can you fix this?


https://github.com/llvm/llvm-project/pull/89047


More information about the llvm-commits mailing list