[PATCH] D95400: [flang][fir] Upstream FIR support changes

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 28 12:53:12 PST 2021


mehdi_amini added inline comments.


================
Comment at: flang/lib/Optimizer/Support/FIRContext.cpp:24
+  mod->setAttr(tripleName, fir::OpaqueAttr::get(mod.getContext(), &triple));
+}
+
----------------
schweitz wrote:
> mehdi_amini wrote:
> > The triple seems fairly fundamental to processing a Module, it isn't clear to me that this can be an OpaqueAttr (i.e. something that should be implicitly dropped freely with no consequence). How do you manage this?
> It is definitely important, actually essential, for conversion to LLVM IR.
> 
> Prior to that, the IR is abstract enough that it can be reasoned about without knowing the target triple precisely.
> 
> The trick here is that the driver of the code gen bridge will supply a triple. Thus, we can keep the IR and the triple loosely coupled.
> 
> I know that Alex is looking at solutions to this on the MLIR side. So it could be the case that solution can just be substituted.
> 
Even here why don't you set it as a string attribute which can round-trip and not be an opaque attribute?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95400/new/

https://reviews.llvm.org/D95400



More information about the llvm-commits mailing list