[Mlir-commits] [mlir] [mlir] Always update ExtractValue to use last container in insert chain (PR #176588)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sun Jan 18 16:41:51 PST 2026


================
@@ -1928,11 +1928,20 @@ OpFoldResult LLVM::ExtractValueOp::fold(FoldAdaptor adaptor) {
     return getResult();
   }
 
-  Operation *container = getContainer().getDefiningOp();
-  OpFoldResult result = {};
+  Attribute containerAttr;
+  if (matchPattern(getContainer(), m_Constant(&containerAttr))) {
----------------
neildhar wrote:

I moved it back to the top (where it was prior to #172297) mostly to keep the possible paths through the function simple. The same logic would also apply to the check for `ExtractValueOp` containers right at the top, but having everything at the bottom makes it slightly more complicated to track what has changed because multiple cases could apply in a single invocation.

That said, I am happy to change it if you feel strongly.

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


More information about the Mlir-commits mailing list