[PATCH] D12199: Add framework for iterative compilation to llvm

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Tue May 3 10:52:24 PDT 2016


grosser added a comment.

Hi Zoran,

me and one of my students started to play with this patch. However, unfortunately it does not seem to work. Using a minimal example:

$ cat /tmp/test.c 
int main() {}

we see the following error:

bin/clang -S -fiterative-comp=2 /tmp/test.c -c 
ITERATIVE COMPILATION ERROR:

The problem seems to be that only one file is written during module finalization:

  if (ICPhase != FnNameAndPhase::CodeGenPhase) {                               
    resultsFile = new ICResultsFile(FicResultsFile);                           
  }                                                                            
  else {                                                                       
    resultsFile = new ICResultsFile(FicResultsFile2);                          
  }     

but both files are unconditionally read by clang:

  +int loadResultFiles(llvm::ModuleDecisionTrees &MDT,
  +                    std::vector<llvm::MdtResults> &merged) {
  +  llvm::ICResultsFile results1 = MDT.getICResultsFile();
  +  llvm::ICResultsFile results2 = MDT.getICResultsFile2();
  +
  +  int r1 = results1.read();
  +  int r2 = results2.read();
  +
  +  if(r1 || r2)
  +    return 1;
  +
  +  llvm::MdtResults::mergeMdtResults(merged,
  +      results1.getResults(), results2.getResults());
  +
  +  return 0;
  +}

It is currently unclear what the expected behavior is. Do you happen a minimal example that would allow us to use this IC patch with clang and see at least two different inlining choices to be explored?


http://reviews.llvm.org/D12199





More information about the llvm-commits mailing list