@@ -250,6 +250,26 @@ define void @no_counters() {
250
250
call void @bar ()
251
251
ret void
252
252
}
253
+
254
+ ; Ensure "calls" to inline asm don't get callsite-instrumented.
255
+ define void @inlineasm () {
256
+ ; INSTRUMENT-LABEL: define void @inlineasm() {
257
+ ; INSTRUMENT-NEXT: call void @llvm.instrprof.increment(ptr @inlineasm, i64 742261418966908927, i32 1, i32 0)
258
+ ; INSTRUMENT-NEXT: call void asm "nop", ""()
259
+ ; INSTRUMENT-NEXT: ret void
260
+ ;
261
+ ; LOWERING-LABEL: define void @inlineasm(
262
+ ; LOWERING-SAME: ) !guid [[META6:![0-9]+]] {
263
+ ; LOWERING-NEXT: [[TMP1:%.*]] = call ptr @__llvm_ctx_profile_get_context(ptr @inlineasm, i64 -3771893999295659109, i32 1, i32 0)
264
+ ; LOWERING-NEXT: [[TMP2:%.*]] = ptrtoint ptr [[TMP1]] to i64
265
+ ; LOWERING-NEXT: [[TMP3:%.*]] = and i64 [[TMP2]], -2
266
+ ; LOWERING-NEXT: [[TMP4:%.*]] = inttoptr i64 [[TMP3]] to ptr
267
+ ; LOWERING-NEXT: call void asm "nop", ""()
268
+ ; LOWERING-NEXT: ret void
269
+ ;
270
+ call void asm "nop" , "" ()
271
+ ret void
272
+ }
253
273
;.
254
274
; LOWERING: attributes #[[ATTR0:[0-9]+]] = { nounwind }
255
275
; LOWERING: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
@@ -262,4 +282,5 @@ define void @no_counters() {
262
282
; LOWERING: [[META3]] = !{i64 -3006003237940970099}
263
283
; LOWERING: [[META4]] = !{i64 5679753335911435902}
264
284
; LOWERING: [[META5]] = !{i64 5458232184388660970}
285
+ ; LOWERING: [[META6]] = !{i64 -3771893999295659109}
265
286
;.
0 commit comments