File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 25
25
#include " llvm/IR/GlobalValue.h"
26
26
#include " llvm/IR/Instruction.h"
27
27
#include " llvm/IR/Instructions.h"
28
+ #include " llvm/IR/IntrinsicInst.h"
28
29
#include " llvm/IR/LLVMContext.h"
29
30
#include " llvm/IR/Metadata.h"
30
31
#include " llvm/IR/Module.h"
@@ -211,6 +212,9 @@ DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key,
211
212
else if (isa<Constant>(V)) {
212
213
raw_string_ostream OS (Val);
213
214
V->printAsOperand (OS, /* PrintType=*/ false );
215
+ } else if (auto *II = dyn_cast<IntrinsicInst>(V)) {
216
+ raw_string_ostream OS (Val);
217
+ OS << " call " << II->getCalledFunction ()->getName ();
214
218
} else if (auto *I = dyn_cast<Instruction>(V)) {
215
219
Val = I->getOpcodeName ();
216
220
} else if (auto *MD = dyn_cast<MetadataAsValue>(V)) {
Original file line number Diff line number Diff line change 62
62
; YAML-NEXT: - ClobberedBy: store
63
63
; YAML-NEXT: DebugLoc: { File: '/tmp/s.c', Line: 2, Column: 10 }
64
64
; YAML-NEXT: ...
65
+ ; YAML-NEXT: --- !Missed
66
+ ; YAML-NEXT: Pass: gvn
67
+ ; YAML-NEXT: Name: LoadClobbered
68
+ ; YAML-NEXT: Function: lifetime_end
69
+ ; YAML-NEXT: Args:
70
+ ; YAML-NEXT: - String: 'load of type '
71
+ ; YAML-NEXT: - Type: i8
72
+ ; YAML-NEXT: - String: ' not eliminated'
73
+ ; YAML-NEXT: - String: ' in favor of '
74
+ ; YAML-NEXT: - OtherAccess: store
75
+ ; YAML-NEXT: - String: ' because it is clobbered by '
76
+ ; YAML-NEXT: - ClobberedBy: call llvm.lifetime.end.p0
77
+ ; YAML-NEXT: ...
65
78
66
79
define i32 @arg (ptr %p , i32 %i ) {
67
80
entry:
@@ -93,6 +106,15 @@ entry:
93
106
%add = add i32 %load1 , %load
94
107
ret i32 %add
95
108
}
109
+
110
+ define i8 @lifetime_end (ptr %p , i8 %val ) {
111
+ call void @llvm.lifetime.start.p0 (i64 32 , ptr %p )
112
+ store i8 %val , ptr %p
113
+ call void @llvm.lifetime.end.p0 (i64 32 , ptr %p )
114
+ %1 = load i8 , ptr %p
115
+ ret i8 %1
116
+ }
117
+
96
118
!llvm.dbg.cu = !{!0 }
97
119
!llvm.module.flags = !{!3 , !4 , !5 }
98
120
!llvm.ident = !{!6 }
You can’t perform that action at this time.
0 commit comments