Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Aug 2024 09:24:53 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: b998525875c4 - stable/14 - Merge commit d2353ae00c3b from llvm git (by Argyrios Kyrtzidis):
Message-ID:  <202408130924.47D9OrcM021421@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=b998525875c47602313ac223eb35f7e51df3b50a

commit b998525875c47602313ac223eb35f7e51df3b50a
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-08-10 21:03:27 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-08-13 09:24:24 +0000

    Merge commit d2353ae00c3b from llvm git (by Argyrios Kyrtzidis):
    
      [utils/TableGen/X86CompressEVEXTablesEmitter.cpp] Make sure the tablegen output for the `checkPredicate` function is deterministic (#84533)
    
      The output for the `checkPredicate` function was depending on a
      `std::map` iteration that was non-deterministic from run to run, because
      the keys were pointer values.
    
      Make a change so that the keys are `StringRef`s so the ordering is
      stable.
    
    This avoids non-determinism in llvm-tblgen output, which could cause
    differences in the generated X86GenCompressEVEXTables.inc file. Although
    these differences are not influencing the meaning of the generated code,
    they still change a few bytes in libllvm. This in turn influences all
    the binaries linked with libllvm, such as clang, ld.lld, etc.
    
    Reported by:    cperciva
    MFC after:      3 days
    
    (cherry picked from commit 7a8d05ba19b7762596c0ff22e668e4d50bac81cf)
---
 .../llvm/utils/TableGen/X86CompressEVEXTablesEmitter.cpp            | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/contrib/llvm-project/llvm/utils/TableGen/X86CompressEVEXTablesEmitter.cpp b/contrib/llvm-project/llvm/utils/TableGen/X86CompressEVEXTablesEmitter.cpp
index fef8dc7236f5..ee0a96ee5b53 100644
--- a/contrib/llvm-project/llvm/utils/TableGen/X86CompressEVEXTablesEmitter.cpp
+++ b/contrib/llvm-project/llvm/utils/TableGen/X86CompressEVEXTablesEmitter.cpp
@@ -46,7 +46,7 @@ class X86CompressEVEXTablesEmitter {
 
   typedef std::pair<const CodeGenInstruction *, const CodeGenInstruction *>
       Entry;
-  typedef std::map<const Record *, std::vector<const CodeGenInstruction *>>
+  typedef std::map<StringRef, std::vector<const CodeGenInstruction *>>
       PredicateInstMap;
 
   std::vector<Entry> Table;
@@ -89,7 +89,7 @@ void X86CompressEVEXTablesEmitter::printCheckPredicate(
   for (const auto &[Key, Val] : PredicateInsts) {
     for (const auto &Inst : Val)
       OS << "  case X86::" << Inst->TheDef->getName() << ":\n";
-    OS << "    return " << Key->getValueAsString("CondString") << ";\n";
+    OS << "    return " << Key << ";\n";
   }
 
   OS << "  }\n";
@@ -226,7 +226,7 @@ void X86CompressEVEXTablesEmitter::run(raw_ostream &OS) {
              Name == "HasAVXIFMA";
     });
     if(It!= Predicates.end())
-      PredicateInsts[*It].push_back(NewInst);
+      PredicateInsts[(*It)->getValueAsString("CondString")].push_back(NewInst);
   }
 
   printTable(Table, OS);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202408130924.47D9OrcM021421>