summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetPassConfig.cpp
diff options
context:
space:
mode:
authorSteven Wu <stevenwu@apple.com>2023-02-01 09:24:44 -0800
committerSteven Wu <stevenwu@apple.com>2023-02-01 09:25:02 -0800
commit516e301752560311d2cd8c2b549493eb0f98d01b (patch)
treea6b555b8afe603a15ec28515436a074ea2157edc /llvm/lib/CodeGen/TargetPassConfig.cpp
parent62bd944e42472b7aa01fe6f662d848d76a96b8f8 (diff)
[NFC][Profile] Access profile through VirtualFileSystem
Make the access to profile data going through virtual file system so the inputs can be remapped. In the context of the caching, it can make sure we capture the inputs and provided an immutable input as profile data. Reviewed By: akyrtzi, benlangmuir Differential Revision: https://reviews.llvm.org/D139052
Diffstat (limited to 'llvm/lib/CodeGen/TargetPassConfig.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetPassConfig.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp
index 3127328c363e..a047e66dcc01 100644
--- a/llvm/lib/CodeGen/TargetPassConfig.cpp
+++ b/llvm/lib/CodeGen/TargetPassConfig.cpp
@@ -42,6 +42,7 @@
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/SaveAndRestore.h"
#include "llvm/Support/Threading.h"
+#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/Target/CGPassBuilderOption.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Transforms/Scalar.h"
@@ -1149,9 +1150,9 @@ void TargetPassConfig::addMachinePasses() {
sampleprof::FSDiscriminatorPass::Pass1));
const std::string ProfileFile = getFSProfileFile(TM);
if (!ProfileFile.empty() && !DisableRAFSProfileLoader)
- addPass(
- createMIRProfileLoaderPass(ProfileFile, getFSRemappingFile(TM),
- sampleprof::FSDiscriminatorPass::Pass1));
+ addPass(createMIRProfileLoaderPass(ProfileFile, getFSRemappingFile(TM),
+ sampleprof::FSDiscriminatorPass::Pass1,
+ nullptr));
}
// Run register allocation and passes that are tightly coupled with it,
@@ -1525,9 +1526,9 @@ void TargetPassConfig::addBlockPlacement() {
sampleprof::FSDiscriminatorPass::Pass2));
const std::string ProfileFile = getFSProfileFile(TM);
if (!ProfileFile.empty() && !DisableLayoutFSProfileLoader)
- addPass(
- createMIRProfileLoaderPass(ProfileFile, getFSRemappingFile(TM),
- sampleprof::FSDiscriminatorPass::Pass2));
+ addPass(createMIRProfileLoaderPass(ProfileFile, getFSRemappingFile(TM),
+ sampleprof::FSDiscriminatorPass::Pass2,
+ nullptr));
}
if (addPass(&MachineBlockPlacementID)) {
// Run a separate pass to collect block placement statistics.