cdl-saarland / rv

RV: A Unified Region Vectorizer for LLVM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build RV as a LLVM plugin

vchuravy opened this issue · comments

I was thinking about how best to deploy RV for my usecase and I am curious if anyone has tried building RV as an LLVM/opt plugin.

We link against the LLVM dylib and being able to dlopen and then add the RV passes would greatly simplify the deployment for us.

That's available in the NEC version (hpce/develop branch): sx-aurora-dev@ff98942
I'll pick the patch onto master.

Fixed by 86ffc07

I might have missed something. I got a LLVMRV.so instead of libRV.so, is this expected?

Also, with this commit, I can't do opt -load <path_to_lib>/LLVMRV.so -rv helloworld.ll because it doesn't recognize the -rv option. This is the same for clang++ -O3 -fplugin=<path_to_lib>/LLVMRV.so -mllvm -rv helloworld.cpp. I'm new to LLVM pass managers and plugins.. The registerRVPasses wasn't invoked in my case.. Are we missing the static RegisterPass<PassName> in all the passes or some other magic parts?

Thanks~

I might have missed something. I got a LLVMRV.so instead of libRV.so, is this expected?

Also, with this commit, I can't do opt -load <path_to_lib>/LLVMRV.so -rv helloworld.ll because it doesn't recognize the -rv option. This is the same for clang++ -O3 -fplugin=<path_to_lib>/LLVMRV.so -mllvm -rv helloworld.cpp. I'm new to LLVM pass managers and plugins.. The registerRVPasses wasn't invoked in my case.. Are we missing the static RegisterPass<PassName> in all the passes or some other magic parts?

Thanks~

There should still be a libRV.so if there was one before. What's your build configuration (cmake args)?

Actually I've got 2 files LLVMRV.so and libRV.a using the following cmake args along with other LLVM cmake args.
The rv folder is at llvm-project/rv along side the llvm and clang folder.

             -DLLVM_EXTERNAL_PROJECTS="rv" \
             -DLLVM_EXTERNAL_RV_SOURCE_DIR=../rv \
             -DRV_ENABLE_CRT=on \
             -DRV_ENABLE_SLEEF=on \
             -DRV_ENABLE_ADVSIMD=on \

I could manually convert libRV.a to a .so file, tho.

Update

I manually converted the libRV.a to libRV.so and pass registration worked. I will double check my build config. Thanks~~