https://llvm.org/bugs/show_bug.cgi?id=23690

            Bug ID: 23690
           Summary: PGO for macro expansion code
           Product: new-bugs
           Version: 3.5
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

#define GET_BIT(lll)    \
    // blah blah

#define G(label1,label2)   \
{                                      \
  // decent amount code  \
  ...
  while (1) {                       \
  GET_BIT(label2);             \
  };                                    \
}

void f() {
   if (..)
     G('c', 'd');

   while ( .. )
       G('a','b');
}

(This simplified case is from SPEC2006 401.bzip2 decompress.c)

After perf sampling, a lot of samples that should have landed in G and
GET_BIT is attributed to the two lines that have G expansion.
Discriminator does not work either for this case. However  the last
field of DW_TAG_lexical_block ("Unique ID to identify blocks from a
template function") is unique for all instances of scopes in G and
GET_BIT. It will be great to have PGO get better profile of hot and
cold paths inside macros with nontrivial scopes.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to