From 1273e415ed8e02a4d2ecd40a6ee61283b179e936 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Wed, 26 Feb 2025 07:39:17 -0800 Subject: [PATCH] Integrate LLVM at llvm/llvm-project@a98c2940dbc0 Updates LLVM usage to match [a98c2940dbc0](https://github.com/llvm/llvm-project/commit/a98c2940dbc0) PiperOrigin-RevId: 731312767 --- bazel/import_llvm.bzl | 2 +- patches/llvm.patch | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/bazel/import_llvm.bzl b/bazel/import_llvm.bzl index 359108b72..b8e19a108 100644 --- a/bazel/import_llvm.bzl +++ b/bazel/import_llvm.bzl @@ -7,7 +7,7 @@ load( def import_llvm(name): """Imports LLVM.""" - LLVM_COMMIT = "9889de834b0a9fa4a5a222a81a524c75977e41d4" + LLVM_COMMIT = "a98c2940dbc04bf84de95cb1893694cdcbc4f5fe" new_git_repository( name = name, diff --git a/patches/llvm.patch b/patches/llvm.patch index 509398da9..378ac4359 100644 --- a/patches/llvm.patch +++ b/patches/llvm.patch @@ -1 +1,29 @@ Auto generated patch. Do not edit or delete it, even if empty. +diff -ruN --strip-trailing-cr a/llvm/lib/CodeGen/RegAllocFast.cpp b/llvm/lib/CodeGen/RegAllocFast.cpp +--- a/llvm/lib/CodeGen/RegAllocFast.cpp ++++ b/llvm/lib/CodeGen/RegAllocFast.cpp +@@ -984,6 +984,7 @@ + + LiveRegMap::iterator LRI = findLiveVirtReg(VirtReg); + MCPhysReg PhysReg; ++ bool IsRenamable = true; + if (LRI != LiveVirtRegs.end() && LRI->PhysReg) { + PhysReg = LRI->PhysReg; + } else { +@@ -997,6 +998,7 @@ + // basic. + PhysReg = getErrorAssignment(*LRI, *MO.getParent(), RC); + LRI->Error = true; ++ IsRenamable = false; + } else + PhysReg = AllocationOrder.front(); + } +@@ -1007,7 +1009,7 @@ + MO.setSubReg(0); + } + MO.setReg(PhysReg); +- MO.setIsRenamable(!LRI->Error); ++ MO.setIsRenamable(IsRenamable); + } + + /// Variation of defineVirtReg() with special handling for livethrough regs