[Mlir-commits] [mlir] [MLIR][LLVM] Improve inline asm importer (PR #139989)
Tobias Gysi
llvmlistbot at llvm.org
Wed May 14 23:04:18 PDT 2025
================
@@ -2073,6 +2073,42 @@ LogicalResult ModuleImport::convertIntrinsic(llvm::CallInst *inst) {
return emitError(loc) << "unhandled intrinsic: " << diag(*inst);
}
+ArrayAttr
+ModuleImport::convertAsmInlineOperandAttrs(const llvm::CallBase &llvmCall) {
+ const llvm::InlineAsm *ia =
+ cast<llvm::InlineAsm>(llvmCall.getCalledOperand());
+ unsigned argIdx = 0;
+ SmallVector<mlir::Attribute> opAttrs;
+ bool hasIndirect = false;
+
+ for (const llvm::InlineAsm::ConstraintInfo &ci : ia->ParseConstraints()) {
+ if (ci.Type == llvm::InlineAsm::isLabel)
+ continue;
+
+ // Only deal with constraints that correspond to call arguments.
+ if (!ci.hasArg())
+ continue;
+
+ if (ci.isIndirect) {
----------------
gysit wrote:
It seems we are guaranteed to see the argument attributes in the order of all arguments? When reading the code this is somewhat unintuitive. Maybe some comment that we are guaranteed to see a constraint info for every argument makes sense?
https://github.com/llvm/llvm-project/pull/139989
More information about the Mlir-commits
mailing list