[PATCH] D106989: [IRSim] Finding Branch Similarity
    Andrew Litteken via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Sep  3 16:04:14 PDT 2021
    
    
  
AndrewLitteken added inline comments.
================
Comment at: llvm/lib/Transforms/IPO/IROutliner.cpp:1361
+  IRInstructionDataList::iterator NextIDIt = std::next(ID.getIterator());
+  Instruction *NextIDLInst = NextIDIt->Inst;
+  Instruction *NextModuleInst = nullptr;
----------------
paquette wrote:
> Can NextIDIt be the end/one past the end? Is this accessible in those cases?
It shouldn’t be. This is looking from the start of the candidate to the end of the candidate, which should only ever include actual instructions. So it could be the end of the function, in which case there is a buffer IRInstructionData which is the nullptr, which is what we are checking here.
================
Comment at: llvm/test/Transforms/IROutliner/region-end-of-module.ll:3
+; RUN: opt -S -verify -iroutliner -ir-outlining-no-cost < %s | FileCheck %s
+
+; This test checks that we do not fail when there is a similarity group with
----------------
paquette wrote:
> each of the cases here end in a `br`.
> 
> What about `unreachable` and `ret`?
Those are into checked for similarity right now, and are excluded from the candidates as a result.
But I can add a function that ends in both for potential future developments.
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106989/new/
https://reviews.llvm.org/D106989
    
    
More information about the llvm-commits
mailing list