[llvm] 209e7ef - X86: Do not use ValueMap for PreallocatedIds
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 19 18:43:15 PDT 2022
Author: Matt Arsenault
Date: 2022-04-19T21:07:47-04:00
New Revision: 209e7ef8740838479b79c5b8dfe4d0a820e1e2f0
URL: https://github.com/llvm/llvm-project/commit/209e7ef8740838479b79c5b8dfe4d0a820e1e2f0
DIFF: https://github.com/llvm/llvm-project/commit/209e7ef8740838479b79c5b8dfe4d0a820e1e2f0.diff
LOG: X86: Do not use ValueMap for PreallocatedIds
ValueMap should only be necessary if the IR values can be
replaced. This is only used during codegen, when it's illegal to
change the underlying IR. This allows using the default copy
constructor for X86MachineFunctionInfo.
I'm not happy about targets keeping state here that's only used in one
specific pass, but we don't have a better place to put it right now.
Added:
Modified:
llvm/lib/Target/X86/X86MachineFunctionInfo.h
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86MachineFunctionInfo.h b/llvm/lib/Target/X86/X86MachineFunctionInfo.h
index 99d1a97380dd9..5c0ba2c9a299a 100644
--- a/llvm/lib/Target/X86/X86MachineFunctionInfo.h
+++ b/llvm/lib/Target/X86/X86MachineFunctionInfo.h
@@ -119,7 +119,9 @@ class X86MachineFunctionInfo : public MachineFunctionInfo {
Optional<int> SwiftAsyncContextFrameIdx;
- ValueMap<const Value *, size_t> PreallocatedIds;
+ // Preallocated fields are only used during isel.
+ // FIXME: Can we find somewhere else to store these?
+ DenseMap<const Value *, size_t> PreallocatedIds;
SmallVector<size_t, 0> PreallocatedStackSizes;
SmallVector<SmallVector<size_t, 4>, 0> PreallocatedArgOffsets;
More information about the llvm-commits
mailing list