[all-commits] [llvm/llvm-project] 6261ad: [InstCombine] Fold more intrinsics over selects

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Mar 31 07:32:39 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6261adfa51f2d93c8258e7b2d9811d607f3e50a5
      https://github.com/llvm/llvm-project/commit/6261adfa51f2d93c8258e7b2d9811d607f3e50a5
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-03-31 (Fri, 31 Mar 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/test/Transforms/InstCombine/intrinsic-select.ll

  Log Message:
  -----------
  [InstCombine] Fold more intrinsics over selects

Move this handling to a centralized place and extend it to handle
saturating add/sub intrinsics.

I originally wanted to make this fully generic rather than
whitelist based, because this is legal and likely profitable for all
speculatable intrinsics. The caveat is that for vector selects,
the intrinsic can't perform cross-lane operations like a shuffle
or reduction, which we don't really expose as a generic property
right now. So for now I'm just extending the list.




More information about the All-commits mailing list