This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Fix checks for native arch
ClosedPublic

Authored by nikic on Aug 3 2022, 7:17 AM.

Details

Summary

Using if (TARGET ${LLVM_NATIVE_ARCH}) only works if MLIR is built together with LLVM, but not for standalone builds of MLIR. The correct way to check this is if (${LLVM_NATIVE_ARCH} IN_LIST LLVM_TARGETS_TO_BUILD), as the LLVM build system exports LLVM_TARGETS_TO_BUILD.

Diff Detail

Event Timeline

nikic created this revision.Aug 3 2022, 7:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2022, 7:17 AM
nikic requested review of this revision.Aug 3 2022, 7:17 AM
nikic updated this revision to Diff 449893.Aug 4 2022, 12:23 AM

Add a MLIR_ENABLE_EXECUTION_ENGINE variable to avoid repeating the same check and comment everywhere.

mehdi_amini accepted this revision.Aug 4 2022, 12:54 AM
This revision is now accepted and ready to land.Aug 4 2022, 12:54 AM
This revision was automatically updated to reflect the committed changes.