[llvm] cf34559 - [RISCV] Enable PrimaryKeyEarlyOut on RISCVVPseudosTable.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 19:07:59 PST 2021


Author: Craig Topper
Date: 2021-02-18T18:59:32-08:00
New Revision: cf34559104d3531e98e16ea242b777f18d5f95cf

URL: https://github.com/llvm/llvm-project/commit/cf34559104d3531e98e16ea242b777f18d5f95cf
DIFF: https://github.com/llvm/llvm-project/commit/cf34559104d3531e98e16ea242b777f18d5f95cf.diff

LOG: [RISCV] Enable PrimaryKeyEarlyOut on RISCVVPseudosTable.

This table is queried in RISCVMCInstLower without knowing
whether the instruction is a vector pseudo. Due to the way the
binary search works, we have to do log2(tablesize) checks just
to determine a non-vector instruction isn't in the table.

Conveniently, all the vector pseudos are pretty tightly
packed within the internal instruction enum. By enabling the
PrimaryKeyEarlyOut, tablegen will emit a check against the
beginning and end of the table before doing the binary search.
This gives a quick early out on the search for the majority
of non-vector instructions.

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

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td b/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
index 4e3a261ba299..20f37400bd7f 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
@@ -402,6 +402,7 @@ def RISCVVPseudosTable : GenericTable {
   let Fields = [ "Pseudo", "BaseInstr" ];
   let PrimaryKey = [ "Pseudo" ];
   let PrimaryKeyName = "getPseudoInfo";
+  let PrimaryKeyEarlyOut = true;
 }
 
 def RISCVVIntrinsicsTable : GenericTable {


        


More information about the llvm-commits mailing list