[Mlir-commits] [mlir] [mlir] [bufferize] fix crash when bufferize function without func.return returning op (PR #120675)

donald chen llvmlistbot at llvm.org
Tue Dec 24 04:22:39 PST 2024


================
@@ -268,4 +268,10 @@ func.func @materialize_in_dest_raw(%f: f32, %f2: f32, %idx: index) -> (tensor<5x
   %r = tensor.extract %dest_filled[%idx] : tensor<5xf32>
 
   return %0, %r : tensor<5xf32>, f32
-}
\ No newline at end of file
+}
+
+// -----
+// CHECK-LABEL: @llvm_return
+func.func @llvm_return() {
+   llvm.return
----------------
cxy-1993 wrote:

This case is from https://github.com/llvm/llvm-project/issues/120535.

A `func.func` with `llvm.return` is legal IMO. `func.return` doesn't check parent op in verifier and this is common in a conversion with mannul selected patterns.

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


More information about the Mlir-commits mailing list