[PATCH] D113091: [fir] Use notifyMatchFailure in fir.zero_bits conversion

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 3 02:37:05 PDT 2021


clementval created this revision.
clementval added reviewers: mehdi_amini, jeanPerier, svedanayagam, sscalpone, kiranchandramohan, jdoerfert, schweitz, pmccormick, rovka, AlexisPerry, PeteSteinfeld.
Herald added a project: Flang.
clementval requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Change emitOpError to notifyMatchFailure in conversion pattern.

Post-commit change after D113014 <https://reviews.llvm.org/D113014>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113091

Files:
  flang/lib/Optimizer/CodeGen/CodeGen.cpp
  flang/test/Fir/convert-to-llvm-invalid.fir


Index: flang/test/Fir/convert-to-llvm-invalid.fir
===================================================================
--- flang/test/Fir/convert-to-llvm-invalid.fir
+++ flang/test/Fir/convert-to-llvm-invalid.fir
@@ -3,7 +3,6 @@
 // RUN: fir-opt --split-input-file --fir-to-llvm-ir --verify-diagnostics %s
 
 func @zero_aggregate() {
-  // expected-error at +2{{'fir.zero_bits' op conversion of fir.zero with aggregate type not implemented yet}}
   // expected-error at +1{{failed to legalize operation 'fir.zero_bits'}}
   %a = fir.zero_bits !fir.array<10xf32>
   return
Index: flang/lib/Optimizer/CodeGen/CodeGen.cpp
===================================================================
--- flang/lib/Optimizer/CodeGen/CodeGen.cpp
+++ flang/lib/Optimizer/CodeGen/CodeGen.cpp
@@ -196,7 +196,8 @@
           zero, ty, mlir::FloatAttr::get(zero.getType(), 0.0));
     } else {
       // TODO: create ConstantAggregateZero for FIR aggregate/array types.
-      return zero.emitOpError(
+      return rewriter.notifyMatchFailure(
+          zero,
           "conversion of fir.zero with aggregate type not implemented yet");
     }
     return success();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113091.384367.patch
Type: text/x-patch
Size: 1143 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211103/2fbb0d8c/attachment.bin>


More information about the llvm-commits mailing list