[all-commits] [llvm/llvm-project] 573fa7: [TableGen][GlobalISel] Add rule-wide type inferenc...

Pierre van Houtryve via All-commits all-commits at lists.llvm.org
Tue Nov 7 23:10:36 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 573fa770d07bacd9276370454be32731fca99eea
      https://github.com/llvm/llvm-project/commit/573fa770d07bacd9276370454be32731fca99eea
  Author: Pierre van Houtryve <pierre.vanhoutryve at amd.com>
  Date:   2023-11-08 (Wed, 08 Nov 2023)

  Changed paths:
    M llvm/include/llvm/Target/GenericOpcodes.td
    M llvm/include/llvm/Target/GlobalISel/Combine.td
    M llvm/test/TableGen/GlobalISelCombinerEmitter/pattern-errors.td
    A llvm/test/TableGen/GlobalISelCombinerEmitter/type-inference.td
    M llvm/test/TableGen/GlobalISelCombinerEmitter/typeof-errors.td
    M llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp

  Log Message:
  -----------
  [TableGen][GlobalISel] Add rule-wide type inference (#66377)

The inference is trivial and leverages the MCOI OperandTypes encoded in
CodeGenInstructions to infer types across patterns in a CombineRule.
It's thus very limited and only supports CodeGenInstructions (but that's the
main use case so it's fine).

We only try to infer untyped operands in apply patterns when they're
temp reg defs, or immediates. Inference always outputs a `GITypeOf<$x>` where
$x is a named operand from a match pattern.

This allows us to drop the `GITypeOf` in most cases without any errors.




More information about the All-commits mailing list