llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[flang][HLFIR] simplify-hlfir-intrinsics-pack.fir fails due to overflow flag mismatch

Open purnima-nlp opened this issue 1 month ago • 4 comments

The Linux x86_64 pre-merge test suite is failing in:

Flang :: HLFIR/simplify-hlfir-intrinsics-pack.fir

The failure is caused by a mismatch in the expected arith.subi overflow flags.

For example, the test expects:

arith.subi ... overflow<nuw> : index

but the generated IR contains:

arith.subi ... overflow<nsw> : index

and in another case:

arith.subi ... overflow<nsw, nuw> : index

The failing command is:

fir-opt --simplify-hlfir-intrinsics \
  flang/test/HLFIR/simplify-hlfir-intrinsics-pack.fir \
  | FileCheck flang/test/HLFIR/simplify-hlfir-intrinsics-pack.fir

Test summary:

Total Discovered Tests: 5236
Passed: 5013
Expectedly Failed: 11
Failed: 1

The only failing test is:

Flang :: HLFIR/simplify-hlfir-intrinsics-pack.fir

This appears to be either an outdated FileCheck expectation or a recent change in the overflow flags produced by simplify-hlfir-intrinsics.

Failed Tests: Flang :: HLFIR/simplify-hlfir-intrinsics-pack.fir

Relevant command:

fir-opt --simplify-hlfir-intrinsics
flang/test/HLFIR/simplify-hlfir-intrinsics-pack.fir
| FileCheck flang/test/HLFIR/simplify-hlfir-intrinsics-pack.fir

It looks like either the expected overflow flags in the test need updating or there has been a behavioral change in how the HLFIR simplification constructs index arithmetic.

Observed on Linux x86_64 pre-merge CI.

Please let me know if more information or a standalone reproducer would be useful.

purnima-nlp avatar Oct 08 '26 11:10 purnima-nlp

appears to be in infrastructure issue

purnima-nlp avatar Oct 08 '26 11:10 purnima-nlp

appears to be in infrastructure issue

How so? Please provide any useful info to anyone who may investigate this.

For example, are there buildbots that fail with this error? If the failure happens with upstream main branch, then it would affect anyone. If it happens just in CI for your code change, it may be due to your code change.

eugeneepshteyn avatar Oct 08 '26 13:10 eugeneepshteyn

@llvm/issue-subscribers-flang-ir

Author: purnima shrivastava (purnima-nlp)

The Linux x86_64 pre-merge test suite is failing in:
Flang :: HLFIR/simplify-hlfir-intrinsics-pack.fir

The failure is caused by a mismatch in the expected arith.subi overflow flags.

For example, the test expects:

arith.subi ... overflow&lt;nuw&gt; : index

but the generated IR contains:

arith.subi ... overflow&lt;nsw&gt; : index

and in another case:

arith.subi ... overflow&lt;nsw, nuw&gt; : index

The failing command is:

fir-opt --simplify-hlfir-intrinsics \
  flang/test/HLFIR/simplify-hlfir-intrinsics-pack.fir \
  | FileCheck flang/test/HLFIR/simplify-hlfir-intrinsics-pack.fir

Test summary:

Total Discovered Tests: 5236
Passed: 5013
Expectedly Failed: 11
Failed: 1

The only failing test is:

Flang :: HLFIR/simplify-hlfir-intrinsics-pack.fir

This appears to be either an outdated FileCheck expectation or a recent change in the overflow flags produced by simplify-hlfir-intrinsics.

Failed Tests: Flang :: HLFIR/simplify-hlfir-intrinsics-pack.fir

Relevant command:

fir-opt --simplify-hlfir-intrinsics
flang/test/HLFIR/simplify-hlfir-intrinsics-pack.fir
| FileCheck flang/test/HLFIR/simplify-hlfir-intrinsics-pack.fir

It looks like either the expected overflow flags in the test need updating or there has been a behavioral change in how the HLFIR simplification constructs index arithmetic.

Observed on Linux x86_64 pre-merge CI.

Please let me know if more information or a standalone reproducer would be useful.

For the record: this was not an infrastructure problem. Upstream main was broken from 917ea7696fd6 (#220860) until #230076 landed at 12:02 UTC. #230076 updated the expected arith.subi overflow flags, which #220860 and #229733 had left stale in a merge conflict.

Both #220860 and the #230076 test update were later reverted by #230219, because #220860 broke two AArch64 buildbot tests. On current main the test is back to its original form.

eugeneepshteyn avatar Oct 08 '26 18:10 eugeneepshteyn