[PATCH] D123948: X86: Do not use ValueMap for PreallocatedIds

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 18 09:12:05 PDT 2022


arsenm created this revision.
arsenm added reviewers: aeubanks, rnk, sstefan1, efriedma, craig.topper.
Herald added subscribers: StephenFan, pengfei, hiraditya.
Herald added a project: All.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

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.


https://reviews.llvm.org/D123948

Files:
  llvm/lib/Target/X86/X86MachineFunctionInfo.h


Index: llvm/lib/Target/X86/X86MachineFunctionInfo.h
===================================================================
--- llvm/lib/Target/X86/X86MachineFunctionInfo.h
+++ llvm/lib/Target/X86/X86MachineFunctionInfo.h
@@ -119,7 +119,9 @@
 
   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;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123948.423411.patch
Type: text/x-patch
Size: 617 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220418/819015d8/attachment.bin>


More information about the llvm-commits mailing list