[all-commits] [llvm/llvm-project] 0de035: [LLVM][TableGen] Decrease code size of `Intrinsic:...

Rahul Joshi via All-commits all-commits at lists.llvm.org
Tue Oct 1 09:09:08 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0de0354aa8dcd6afab625c6833cb0f40309c2961
      https://github.com/llvm/llvm-project/commit/0de0354aa8dcd6afab625c6833cb0f40309c2961
  Author: Rahul Joshi <rjoshi at nvidia.com>
  Date:   2024-10-01 (Tue, 01 Oct 2024)

  Changed paths:
    M llvm/test/TableGen/intrinsic-attrs.td
    M llvm/utils/TableGen/IntrinsicEmitter.cpp

  Log Message:
  -----------
  [LLVM][TableGen] Decrease code size of `Intrinsic::getAttributes` (#110573)

Decrease code size of `Intrinsic::getAttributes` function by uniquing
the function and argument attributes separately and using the
`IntrinsicsToAttributesMap` to store argument attribute ID in low 8 bits
and function attribute ID in upper 8 bits.

This reduces the number of cases to handle in the generated switch from
368 to 131, which is ~2.8x reduction in the number of switch cases.

Also eliminate the fixed size array `AS` and `NumAttrs` variable, and
instead call `AttributeList::get` directly from each case, with an
inline array of the <index, AttribueSet> pairs.



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