While profiling LLVM's memory allocation, I noticed that getSubtargetImpl was called quite often (and it allocates heap memory by doing string operations). This simple change to cache the TargetLowering/TargetRegisterInfo in CodeGenPrepare reduces the total number of allocations in my test compile by about 3%
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
+echristo, who did a bunch of this subtarget stuff, in case he has some
extra insight (and/or just so he knows in case other similar things come up)
Comment Actions
Alternately, btw, you can just cache the STI in the pass as well btw. Either works for me.
-eric