[flang-commits] [flang] [flang] Trust the lowering symbol table in the FirOpBuilder lookups (PR #232678)

Eugene Epshteyn via flang-commits flang-commits at lists.llvm.org
Wed Oct 21 09:54:59 PDT 2026


https://github.com/eugeneepshteyn commented:

(This comment was generated with the help of AI)

Re-measured after updating the branch to current `main` (merge of ee216ff7, which already contains #232555). Same reproducer as before (`gen_wide.py N`: a module with N derived types and a 12-line consumer passing `TYPE(top)` to an external), `-O2 -c` of the consumer, wall seconds, idle AMD EPYC 9335 host, everything on local disk, single runs. "before" is `main` at ee216ff7, "after" is `main` plus this PR.

| N | flang before | flang after | ratio |
|---|---|---|---|
| 250 | 1.87 | 1.54 | 1.2× |
| 500 | 5.43 | 3.76 | 1.4× |
| 1000 | 17.70 | 10.35 | 1.7× |

Phase breakdown of the N = 1000 compile (driver phase timer; `flang -ftime-report` only covers LLVM passes):

| phase | before | after |
|---|---|---|
| Lowering | 7.81 s | 0.21 s |
| FIR to LLVM conversion | 1.13 s | 1.13 s |
| LLVM `GlobalOptPass` | 2.99 s | 3.00 s |
| total | 19.95 s | 12.47 s |

Lowering is linear in N after the change (0.05 / 0.10 / 0.21 s at 250 / 500 / 1000). `check-flang` on the updated branch: 6223 passed, 0 failed, 99 unsupported, 11 expected failures.


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


More information about the flang-commits mailing list