[all-commits] [llvm/llvm-project] b184a2: [GlobalISel] Add matchers for specific constants a...

Jessica Paquette via All-commits all-commits at lists.llvm.org
Fri Nov 13 09:25:43 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b184a2eccf3b80eb3ab741e983d4637111942815
      https://github.com/llvm/llvm-project/commit/b184a2eccf3b80eb3ab741e983d4637111942815
  Author: Jessica Paquette <jpaquette at apple.com>
  Date:   2020-11-13 (Fri, 13 Nov 2020)

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h
    M llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
    M llvm/lib/CodeGen/GlobalISel/Utils.cpp
    M llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
    M llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
    M llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp

  Log Message:
  -----------
  [GlobalISel] Add matchers for specific constants and a matcher for negations

It's fairly common to need matchers for a specific constant value, or for
common idioms like finding a negated register.

Add

- `m_SpecificICst`, which returns true when matching a specific value..
- `m_ZeroInt`, which returns true when an integer 0 is matched.
- `m_Neg`, which returns when a register is negated.

Also update a few places which use idioms related to the new matchers.

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




More information about the All-commits mailing list