[all-commits] [llvm/llvm-project] 0c5b22: [SCEV] Infer no-wrap flags for shl by a constant. ...

Florian Hahn via All-commits all-commits at lists.llvm.org
Sat Jul 18 05:37:05 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0c5b2258f0b517c0822e5b2f8e6a8de311d6db9d
      https://github.com/llvm/llvm-project/commit/0c5b2258f0b517c0822e5b2f8e6a8de311d6db9d
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2026-07-18 (Sat, 18 Jul 2026)

  Changed paths:
    M llvm/lib/Analysis/ScalarEvolution.cpp
    M llvm/test/Transforms/IndVarSimplify/drop-exact.ll
    M llvm/test/Transforms/IndVarSimplify/pr66066.ll
    M llvm/test/Transforms/IndVarSimplify/strengthen-overflow.ll
    M llvm/test/Transforms/LoopVectorize/single-early-exit-deref-assumptions.ll

  Log Message:
  -----------
  [SCEV] Infer no-wrap flags for shl by a constant. (#208434)

Treat `shl %a, C` as `mul %a, 1 << C` in
getStrengthenedNoWrapFlagsFromBinOp
if possible.

Only transfer NSW from shl to mul, if the shift amount is < Bitwidth -
1, otherwise the result would be more poisonous.

Alive2 proofs: https://alive2.llvm.org/ce/z/iBPpkv

Compile-time impact in noise:
https://llvm-compile-time-tracker.com/compare.php?from=a037729976f91dc11b41a76834dfca9d8812c4fe&to=2050d622aed5606774f0902b352bbb2142e654e1&stat=instructions:u

PR: https://github.com/llvm/llvm-project/pull/208434



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list