[all-commits] [llvm/llvm-project] ad4321: [InstCombine] Fold for masked gather when loading ...

CarolineConcatto via All-commits all-commits at lists.llvm.org
Fri Jan 21 06:20:31 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ad43217a046634be24174299beec3a28018ec3c0
      https://github.com/llvm/llvm-project/commit/ad43217a046634be24174299beec3a28018ec3c0
  Author: Caroline Concatto <caroline.concatto at arm.com>
  Date:   2022-01-21 (Fri, 21 Jan 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    M llvm/test/Transforms/InstCombine/masked_intrinsics.ll

  Log Message:
  -----------
  [InstCombine] Fold for masked gather when loading the same value each time.

This patch checks in the masked gather when the first operand value is a
splat and the mask is all one, because the masked gather is reloading the
same value each time. This patch replaces this pattern of masked gather by
a scalar load of the value and splats it in a vector.

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




More information about the All-commits mailing list