Skip to content
This repository has been archived by the owner on Jan 19, 2025. It is now read-only.

Kulikov Artem. Lab 3. Var 1 #99

Merged
merged 10 commits into from
Apr 25, 2024

Conversation

AveZorgen
Copy link

No description provided.

@mahbhlddnhakkh
Copy link

mahbhlddnhakkh commented Apr 16, 2024

I think you should add a patch that allows to not modify llvm/lib/Target/X86/CMakeLists.txt, llvm/lib/Target/X86/X86.h and llvm/lib/Target/X86/X86TargetMachine.cpp for every lab so it will add/register new labs automatically. Or else it's a recipe for conflicts disaster.

For CMakeLists.txt there should be solutions already. As for llvm/lib/Target/X86/X86.h and llvm/lib/Target/X86/X86TargetMachine.cpp: preprocessor is an option. And to grab lab's headers files, you can try Nesterov's approach. File . add_compile_definitions(PATH_TO_PPC_PROJECT="${CMAKE_SOURCE_DIR}"). In C++ code we can use PATH_TO_PPC_PROJECT as a string path to project root folder. You need to do something similar. E.g. store to constant list of lab's specific files or something like that and in llvm/lib/Target/X86/X86.h and llvm/lib/Target/X86/X86TargetMachine.cpp somehow include required functions with preprocessor.

@nol0n
Copy link

nol0n commented Apr 16, 2024

@mahbhlddnhakkh I think you could try to implement it yourself and offer your solution.

@mahbhlddnhakkh
Copy link

mahbhlddnhakkh commented Apr 16, 2024

Also the pass is not in the llvm/labs/lab3 directory (but it should be), therefore I can't use this lab as a basis for the conflicts solution and I still haven't looked at the code, so... Nuh-uh.

@mahbhlddnhakkh
Copy link

I came up with one solution. Something like this should be implemented. And C++ code for passes should be in llvm/lib/Target/X86/lab3 directory. +function names should follow the same template as this lab.
<labname>.cpp
FunctionPass *create<labname>Pass();
void initialize<labname>PassPass(PassRegistry &);

@AveZorgen
Copy link
Author

@m-ly4

Co-authored-by: m-ly4 <mikelitch@gmail.com>
@m-ly4 m-ly4 merged commit 3f58f8f into NN-complr-tech:course-spring-2024 Apr 25, 2024
5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants