Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F11024302
D66253.diff
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Dec 11, 9:09 AM
Size
1 KB
Mime Type
text/x-patch; charset=utf-8
Expires
Thu, Dec 12, 9:09 AM (23 h, 59 m)
Engine
blob
Format
Raw Data
Handle
6193905
Attached To
D66253: [NewPM][PassInstrumentation] IR printing support for (Thin)LTO
D66253.diff
View Options
Index: llvm/trunk/lib/LTO/LTOBackend.cpp
===================================================================
--- llvm/trunk/lib/LTO/LTOBackend.cpp
+++ llvm/trunk/lib/LTO/LTOBackend.cpp
@@ -28,6 +28,7 @@
#include "llvm/MC/SubtargetFeature.h"
#include "llvm/Object/ModuleSymbolTable.h"
#include "llvm/Passes/PassBuilder.h"
+#include "llvm/Passes/StandardInstrumentations.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
@@ -165,7 +166,10 @@
PGOOptions::IRUse, PGOOptions::CSIRUse);
}
- PassBuilder PB(TM, PipelineTuningOptions(), PGOOpt);
+ PassInstrumentationCallbacks PIC;
+ StandardInstrumentations SI;
+ SI.registerCallbacks(PIC);
+ PassBuilder PB(TM, PipelineTuningOptions(),PGOOpt, &PIC);
AAManager AA;
// Parse a custom AA pipeline if asked to.
Index: llvm/trunk/test/ThinLTO/X86/printer.ll
===================================================================
--- llvm/trunk/test/ThinLTO/X86/printer.ll
+++ llvm/trunk/test/ThinLTO/X86/printer.ll
@@ -0,0 +1,12 @@
+; RUN: llvm-as %s -o %t.bc
+; RUN: llvm-lto2 run -r=%t.bc,foo,pxl -use-new-pm --print-before-all %t.bc -o - 2>&1 | FileCheck %s --check-prefix=CHECK-BEFORE
+; RUN: llvm-lto2 run -r=%t.bc,foo,pxl -use-new-pm --print-after-all %t.bc -o - 2>&1 | FileCheck %s --check-prefix=CHECK-AFTER
+; CHECK-BEFORE: *** IR Dump Before GlobalDCEPass ***
+; CHECK-AFTER: *** IR Dump After GlobalDCEPass ***
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+define i32 @foo() {
+ ret i32 42
+}
Event Timeline
Log In to Comment