[all-commits] [llvm/llvm-project] da4a5a: [InstCombine] Promote expression tree with @llvm.v...

sdesmalen-arm via All-commits all-commits at lists.llvm.org
Thu Feb 2 03:19:47 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: da4a5a46b3c86df436d37f81c0b7849f93d7fbde
      https://github.com/llvm/llvm-project/commit/da4a5a46b3c86df436d37f81c0b7849f93d7fbde
  Author: Sander de Smalen <sander.desmalen at arm.com>
  Date:   2023-02-02 (Thu, 02 Feb 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
    A llvm/test/Transforms/InstCombine/vscale.ll

  Log Message:
  -----------
  [InstCombine] Promote expression tree with @llvm.vscale when zero-extending result.

The LoopVectorizer emits the (scaled) element count as i32, which for
scalable VFs results in calls to @llvm.vscale.i32(). This value is scaled
and further zero-extended to i64.

The zero-extend can be folded away by executing the whole expression in i64
type using @llvm.vscale.i64(). Any logical `and` that would needed to mask
the result can be further folded away by KnownBits analysis when
vscale_range is set.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D143016




More information about the All-commits mailing list