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.
This commit is contained in:
Matt Arsenault 2022-04-18 12:00:04 -04:00
parent e0d585d75a
commit 209e7ef874
1 changed files with 3 additions and 1 deletions

View File

@ -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;