Skip to content

Profiling file not generated #62

Open

Description

@flyree

I found a case when I was running llfi. This is the generated profiling IR:

%178 = landingpad { i8_, i32 } personality i8_ bitcast (i32 (...)* @gxx_personality_v0 to i8)
catch i8
null, !llfi_index !15416
call void @doProfiling(i32 59)
%179 = extractvalue { i8_, i32 } %178, 0, !llfi_index !15417
call void @doProfiling(i32 57)
call void @_clang_call_terminate(i8 %179) #11, !llfi_index !15418
call void @endProfiling()
unreachable, !llfi_index !15419

I am not sure this endProfiling function would be called. This has something to do with the exception handling in c++. I think endProfiling should be added before that terminate call.

Activity

  1. chipbuster commented on Jun 4, 2015

    @chipbuster
    Contributor

    I've been getting a similar issue, though not entirely identical (the symptom is the same as the title of this issue, so I'll leave it here). In my case, main() is not having an endProfiling call placed before the return (following snippet is from main() in IR):

    ; <label>:157                                  ; preds = %151, %147, %144
      ret i32 0                                    ; corresponds to `return 0` at the end of main()
    
    ; <label>:158                                  ; preds = %113
      %159 = load i8** %4
      %160 = load i32* %5
      %161 = insertvalue { i8*, i32 } undef, i8* %159, 0
      %162 = insertvalue { i8*, i32 } %161, i32 %160, 1
      resume { i8*, i32 } %162
    }
    

    Curiously, when the code is compiled under -O3 or -O2, the correct endProfiling() call is inserted.

    The code is the single-threaded LULESH benchmark.

  2. karfair commented on Jun 26, 2015

    @karfair
    Contributor

    @flyree Could you point me to the file you were using so that I can reproduce this bug? Thanks.

  3. flyree commented on Jun 26, 2015

    @flyree
    CollaboratorAuthor

    Hi Phil,

    I have found that it might be because that LLFI cannot deal with exception handling in C++ well. The program I am using is complex, but I guess you can find a c++ file with exception blocks (try/catch) and see how it goes.

    Bo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions