[all-commits] [llvm/llvm-project] 18397f: [RISCV] Use Record from CompressPat in compress/un...
Craig Topper via All-commits
all-commits at lists.llvm.org
Fri Jul 25 14:15:23 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 18397f60633efefcee413d68a1e80cb726bb4d16
https://github.com/llvm/llvm-project/commit/18397f60633efefcee413d68a1e80cb726bb4d16
Author: Craig Topper <craig.topper at sifive.com>
Date: 2025-07-25 (Fri, 25 Jul 2025)
Changed paths:
M llvm/test/TableGen/CompressInstEmitter/suboperands.td
M llvm/utils/TableGen/CompressInstEmitter.cpp
Log Message:
-----------
[RISCV] Use Record from CompressPat in compress/uncompress functions. (#150664)
Instead of using the Record from the instruction definition, use the
Record specified in the CompressPat DAG. This will allow us to use
Records that are subsets of both the source and destination.
I want to use this to merge the C_*_HINT instructions back into their
regular non-HINT versions, but prevent those encodings from being part
of compress/uncompress. For example, we will use GPRNoX0 for the C_ADDI
CompressPat while both C_ADDI and ADDI will use GPR in their instruction
definitions.
To do this I've recorded the original DAG Record in the OperandMap using
a struct in the union to represent the 3 fields needed for an Operand.
Previously we stored TiedOpIdx outside the union, but only used it for
Operand.
There is a verification hole here where we don't have any way to check
that an immediate predicate is a subset of an instruction predicate at
tablegen time. Prior to #148660 we had this hole in one direction, but
that patch made it in two directions. I'm not sure if this patch makes
it any worse. Now we're using what is in the CompressPat where before we
were using whatever was in the instructions and ignoring the predicate
in the CompressPat.
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