When compiling a simple C File with the indirect lowering through mlir, the cir.triple attribute isn't converted to an equivilant llvm.triple. Because of this the compilation fails with
error: unable to create target: 'No available targets are compatible with triple ""'
Since there is no builtin attribute that could be used to represent the target triple in the core dialects, i would suggest including this conversion in the ConvertMLIRToLLVMPass. This way no llvm mlir attribute is used in the core dialect mlir representation, but the target triple is correctly propageted when compiling via llvm.
Here's a minimal example that triggers the issue:
test.c
int main(int argc, char *argv[]) {
// Variables
int number = 15;
number = number + 10;
return 0;
}
when trying to compile this file with the indirect lowering this leads to the following error:
clang -fclangir -fno-clangir-direct-lowering test.c
error: unable to create target: 'No available targets are compatible with triple ""'
1 error generated.