llvm.org GIT mirror llvm / eac2b30
[PGO] Skip value profile instrumentation of inline asm Value profile instrumentation treats inline asm calls like they are indirect calls. This causes problems when the 'Callee' is passed to a ptrtoint cast -- the verifier rightly claims that this is bogus and crashes opt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263278 91177308-0d34-0410-b5e6-96231b3b80d8 Vedant Kumar 3 years ago
2 changed file(s) with 17 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
333333
334334 void visitCallInst(CallInst &I) {
335335 CallSite CS(&I);
336 if (CS.getCalledFunction() || !CS.getCalledValue())
336 if (CS.getCalledFunction() || !CS.getCalledValue() || I.isInlineAsm())
337337 return;
338338 IndirectCallInsts.push_back(&I);
339339 }
0 ; RUN: opt < %s -pgo-instr-gen -S | FileCheck %s
1
2 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
3 target triple = "x86_64-apple-macosx10.12.0"
4
5 define i32 @main() {
6 entry:
7 ; CHECK: call void @llvm.instrprof.increment
8 ; CHECK-NOT: ptrtoint void (i8*)* asm sideeffect
9 ; CHECK-NOT: call void @llvm.instrprof.value.profile
10 ; CHECK: tail call void asm sideeffect
11 tail call void asm sideeffect "", "imr,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* undef) #0
12 ret i32 0
13 }
14
15 attributes #0 = { nounwind }