[all-commits] [llvm/llvm-project] 769c22: [VectorCombine] Fold reduce(trunc(x)) -> trunc(red...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Mon Feb 19 03:32:35 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 769c22f25b81b74e4da7871d4e552584605caef1
      https://github.com/llvm/llvm-project/commit/769c22f25b81b74e4da7871d4e552584605caef1
  Author: Simon Pilgrim <RKSimon at users.noreply.github.com>
  Date:   2024-02-19 (Mon, 19 Feb 2024)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/VectorCombine.cpp
    A llvm/test/Transforms/VectorCombine/X86/reduction-of-truncations.ll

  Log Message:
  -----------
  [VectorCombine] Fold reduce(trunc(x)) -> trunc(reduce(x)) iff cost effective (#81852)

Vector truncations can be pretty expensive, especially on X86, whilst scalar truncations are often free.

If the cost of performing the add/mul/and/or/xor reduction is cheap enough on the pre-truncated type, then avoid the vector truncation entirely.

Fixes https://github.com/llvm/llvm-project/issues/81469



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