This is an archive of the discontinued LLVM Phabricator instance.

Disable the MLIR ExecutionEngine library when the native target is not configured
ClosedPublic

Authored by mehdi_amini on Jan 13 2022, 11:57 PM.

Details

Summary

The execution engine would not be functional anyway, we're already
disabling the tests, this also disable the rest of the code.

Anecdotally this reduces the number of static library built when the
builtin target is disabled goes from 236 to 218.

Here is the complete list of LLVM targets built when running
ninja check-mlir:

libLLVMAggressiveInstCombine.a
libLLVMAnalysis.a
libLLVMAsmParser.a
libLLVMBinaryFormat.a
libLLVMBitReader.a
libLLVMBitstreamReader.a
libLLVMBitWriter.a
libLLVMCore.a
libLLVMDebugInfoCodeView.a
libLLVMDebugInfoDWARF.a
libLLVMDemangle.a
libLLVMFileCheck.a
libLLVMFrontendOpenMP.a
libLLVMInstCombine.a
libLLVMIRReader.a
libLLVMMC.a
libLLVMMCParser.a
libLLVMObject.a
libLLVMProfileData.a
libLLVMRemarks.a
libLLVMScalarOpts.a
libLLVMSupport.a
libLLVMTableGen.a
libLLVMTableGenGlobalISel.a
libLLVMTextAPI.a
libLLVMTransformUtils.a

Diff Detail

Event Timeline

mehdi_amini created this revision.Jan 13 2022, 11:57 PM
mehdi_amini requested review of this revision.Jan 13 2022, 11:57 PM
Herald added a project: Restricted Project. · View Herald Transcript

Thanks for this!

mlir/lib/CAPI/CMakeLists.txt
18–22

If cross-compiling, would this disable the ExecutionEngine? I'm not sure what the semantics of LLVM_NATIVE_ARCH is.

This revision is now accepted and ready to land.Jan 14 2022, 12:13 AM
mehdi_amini added inline comments.Jan 14 2022, 12:15 AM
mlir/lib/CAPI/CMakeLists.txt
18–22

You're right, that won't be the right thing to do...
Maybe we should hook to when -DLLVM_DEFAULT_TARGET_TRIPLE="" instead then. I'll look into this tomorrow

mlir/lib/CAPI/CMakeLists.txt
18–22

I think this is correct when cross-compiling, since it is set from LLVM_TARGET_ARCH, which should be set to the architecture being cross-compiled for.

mehdi_amini added inline comments.Jan 14 2022, 12:19 AM
mlir/lib/CAPI/CMakeLists.txt
18–22

Actually LLVM_NATIVE_ARCH is the crossed-compiled target, so we're fine here.

OOC why is libLLVMIRReader.a built without a target config? (One can built it without, but I'm not sure where it would be used)

OOC why is libLLVMIRReader.a built without a target config? (One can built it without, but I'm not sure where it would be used)

“Target” are the LLVM backends, without a target we lose the ability to JIT or emit native code in general, but can still import/export LLVM IR!