[llvm] [InstSimplify] Fold value-preserving zext/sext of trunc (PR #204089)

Pengcheng Wang via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 29 02:44:51 PDT 2026


wangpc-pp wrote:

> test-suite diff from [f042cf4...f889b46](https://github.com/llvm/llvm-project/compare/f042cf49fa5f17b060bff2cd5122f56ea5c4c752...f889b467941bf5194632e21ce54586dee984e12a): https://github.com/llvm/llvm-project/actions/runs/28356557168/artifacts/7947215205

## Verdict: **Mild net improvement (small, with noise)**

| Metric | base | head | Direction |
|---|---|---|---|
| Real instructions | 15508 | 15174 | ~334 fewer — tighter code ✅ |
| Register spills | 828 | 807 | fewer — lower pressure ✅ |
| Vector ops (`vset*`) | 43 | 96 | more — new vectorization ✅ |
| Stack frames | larger | smaller | e.g. mszip 48→32 ✅ |

**Improvements**: SPASS/rules-sort removes 64-bit index-packing (`slli/srai ...,32`); LCALS and mafft gain new vector loops.

**Regressions**: `mszip_make_decode_table` **lost its SIMD store path** (`vsoxei64.v`/`vwsll`) → scalar fallback (the only potentially impactful one if hot). Bullet shape files add one extra `zext.w` each.

**Most of the diff is noise** (label renumbering, `mv` reordering) with no perf impact.

**Recommendation**: Net improvement. Confirm whether the mszip vectorization loss sits on a hot path — that's the only change that could offset the gains.

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


More information about the llvm-commits mailing list