Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-DMLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON might have found some invalid API usages #7047

Open
7FM opened this issue May 16, 2024 · 2 comments
Labels
Arc Involving the `arc` dialect Calyx The Calyx dialect Comb Involving the `comb` dialect FIRRTL Involving the `firrtl` dialect Handshake help wanted Extra attention is needed HW Involving the `hw` dialect LLHD LoopSchedule

Comments

@7FM
Copy link
Contributor

7FM commented May 16, 2024

While the documentation states that there might be false positives, I think it might be worth a look into the individual test cases and patterns.
If there are no false positives, adding -DMLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON to the CI could be beneficial.

Failed Tests (32):
  CIRCT :: Conversion/LoopScheduleToCalyx/convert_pipeline.mlir
  CIRCT :: Conversion/SCFToCalyx/cider_source_location.mlir
  CIRCT :: Conversion/SCFToCalyx/convert_controlflow.mlir
  CIRCT :: Conversion/SCFToCalyx/convert_func.mlir
  CIRCT :: Conversion/SCFToCalyx/convert_memory.mlir
  CIRCT :: Conversion/SCFToCalyx/convert_simple.mlir
  CIRCT :: Conversion/SCFToCalyx/errors.mlir
  CIRCT :: Dialect/Arc/arc-canonicalizer.mlir
  CIRCT :: Dialect/Arc/canonicalizers.mlir
  CIRCT :: Dialect/Calyx/canonicalization.mlir
  CIRCT :: Dialect/Comb/canonicalization.mlir
  CIRCT :: Dialect/FIRRTL/SFCTests/GrandCentralInterfaces/Wire.fir
  CIRCT :: Dialect/FIRRTL/SFCTests/data-taps.fir
  CIRCT :: Dialect/FIRRTL/SFCTests/invalid-interpretations.fir
  CIRCT :: Dialect/FIRRTL/SFCTests/invalid-reg-pass.fir
  CIRCT :: Dialect/FIRRTL/SFCTests/mem-taps.fir
  CIRCT :: Dialect/FIRRTL/canonicalization.mlir
  CIRCT :: Dialect/FIRRTL/ref.mlir
  CIRCT :: Dialect/FIRRTL/simplify-mems.mlir
  CIRCT :: Dialect/HW/canonicalization.mlir
  CIRCT :: Dialect/HW/inline.mlir
  CIRCT :: Dialect/Handshake/canonicalization.mlir
  CIRCT :: Dialect/LLHD/Canonicalization/extract.mlir
  CIRCT :: firtool/async-reset.fir
  CIRCT :: firtool/chirrtl.fir
  CIRCT :: firtool/firtool.fir
  CIRCT :: firtool/import-ref.fir
  CIRCT :: firtool/lower-memories.fir
  CIRCT :: firtool/prefixMemory.fir
  CIRCT :: firtool/spec/refs/define.fir
  CIRCT :: firtool/spec/refs/nested_refproducer.fir
  CIRCT :: firtool/sv-attr.fir


Testing Time: 2.55s

Total Discovered Tests: 812
  Unsupported      :  12 (1.48%)
  Passed           : 762 (93.84%)
  Expectedly Failed:   6 (0.74%)
  Failed           :  32 (3.94%)

The observed errors are:

  • LLVM ERROR: operation finger print changed
  • LLVM ERROR: pattern returned success but IR did not change
  • LLVM ERROR: IR failed to verify after pattern application
@7FM 7FM added help wanted Extra attention is needed FIRRTL Involving the `firrtl` dialect Handshake HW Involving the `hw` dialect LLHD Calyx The Calyx dialect Comb Involving the `comb` dialect Arc Involving the `arc` dialect LoopSchedule labels May 16, 2024
@dtzSiFive
Copy link
Contributor

Thanks for trying this and reporting!

I'm seeing 34 errors presently on my setup, here's a log but I'll start going through these... https://gist.github.com/dtzSiFive/cc4c9652739f455bb36e36490c98d940 .

Enabling debug prints for pattern application (not included above) helps indicate what pattern caused the bug.

dtzSiFive added a commit to dtzSiFive/circt that referenced this issue May 16, 2024
Detected by -DMLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON.
cc llvm#7047.
dtzSiFive added a commit that referenced this issue May 16, 2024
Detected by -DMLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON.
cc #7047.
dtzSiFive added a commit to dtzSiFive/circt that referenced this issue May 16, 2024
Detected by -DMLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON.

cc llvm#7047.
dtzSiFive added a commit to dtzSiFive/circt that referenced this issue May 16, 2024
Detected by -DMLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON.

cc llvm#7047.
dtzSiFive added a commit to dtzSiFive/circt that referenced this issue May 16, 2024
Detected by -DMLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON.

cc llvm#7047.
dtzSiFive added a commit to dtzSiFive/circt that referenced this issue May 16, 2024
Detected by -DMLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON.

cc llvm#7047.
dtzSiFive added a commit that referenced this issue May 16, 2024
Detected by -DMLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON.

cc #7047.
dtzSiFive added a commit to dtzSiFive/circt that referenced this issue May 16, 2024
Detected by -DMLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON.

cc llvm#7047.
dtzSiFive added a commit to dtzSiFive/circt that referenced this issue May 16, 2024
Detected by -DMLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON.

cc llvm#7047.
dtzSiFive added a commit that referenced this issue May 16, 2024
Detected by -DMLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON.

cc #7047.
dtzSiFive added a commit that referenced this issue May 17, 2024
Detected by -DMLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON.

cc #7047.
dtzSiFive added a commit that referenced this issue May 17, 2024
Fix FoldUnusedPorts to use rewriter for RAUW.
Fix FoldReadWritePorts to use rewriter for RAUW.

Detected by -DMLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON.

cc #7047.

Fix more RAUW's to use rewriter, inspection.
@dtzSiFive
Copy link
Contributor

This is now down to 11 -- 10 once the Handshake PR lands.

Here's the test list, FWIW:

Failed Tests (11):
  CIRCT :: Conversion/LoopScheduleToCalyx/convert_pipeline.mlir
  CIRCT :: Conversion/SCFToCalyx/cider_source_location.mlir
  CIRCT :: Conversion/SCFToCalyx/convert_controlflow.mlir
  CIRCT :: Conversion/SCFToCalyx/convert_func.mlir
  CIRCT :: Conversion/SCFToCalyx/convert_memory.mlir
  CIRCT :: Conversion/SCFToCalyx/convert_simple.mlir
  CIRCT :: Conversion/SCFToCalyx/errors.mlir
  CIRCT :: Dialect/Arc/arc-canonicalizer.mlir
  CIRCT :: Dialect/Arc/canonicalizers.mlir
  CIRCT :: Dialect/Calyx/canonicalization.mlir
  CIRCT :: Dialect/Handshake/canonicalization.mlir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arc Involving the `arc` dialect Calyx The Calyx dialect Comb Involving the `comb` dialect FIRRTL Involving the `firrtl` dialect Handshake help wanted Extra attention is needed HW Involving the `hw` dialect LLHD LoopSchedule
Projects
None yet
Development

No branches or pull requests

2 participants