[Mlir-commits] [mlir] [mlir][LLVM] Add disjoint flag (PR #115855)

Tobias Gysi llvmlistbot at llvm.org
Wed Nov 13 04:25:32 PST 2024


=?utf-8?q?Léon?= Frenot <leon.frenot at ens-lyon.fr>,
=?utf-8?q?Léon?= Frenot <leon.frenot at ens-lyon.fr>,
=?utf-8?q?Léon?= Frenot <leon.frenot at ens-lyon.fr>,
=?utf-8?q?Léon?= Frenot <leon.frenot at ens-lyon.fr>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/115855 at github.com>


================
@@ -1898,6 +1898,12 @@ void ModuleTranslation::setLoopMetadata(Operation *op,
   inst->setMetadata(llvm::LLVMContext::MD_loop, loopMD);
 }
 
+void ModuleTranslation::setDisjointFlag(Operation *op, llvm::Value *value) {
+  auto iface = cast<DisjointFlagInterface>(op);
+  if (auto disjointInst = dyn_cast<llvm::PossiblyDisjointInst>(value))
+    disjointInst->setIsDisjoint(iface.getIsDisjoint());
----------------
gysit wrote:

What operation produces the error on flang? I would expect this function is only called for llvm.or operation? Shouldn't the generated operation also implement the interface? Or may the llvm instruction fold somehow / be a constant?

I am not agains the solution but it would be nice to understand what the root cause is and then add a comment why the cast may fail.

https://github.com/llvm/llvm-project/pull/115855


More information about the Mlir-commits mailing list