[llvm] r323391 - [GlobalISel][TableGen] Fix the statistics for emitted patters

Quentin Colombet via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 24 19:05:23 PST 2018


Good catch!

Thanks for the fix.

> On Jan 24, 2018, at 4:18 PM, Volkan Keles via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> 
> Author: volkan
> Date: Wed Jan 24 16:18:52 2018
> New Revision: 323391
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=323391&view=rev
> Log:
> [GlobalISel][TableGen] Fix the statistics for emitted patters
> 
> Collected statistics for the number of patterns emitted can be
> incorrect because rules can be grouped if OptimizeMatchTable
> is enabled. Increase the counter in RuleMatcher::emit(...)
> to avoid that.
> 
> Modified:
>    llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp
> 
> Modified: llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp?rev=323391&r1=323390&r2=323391&view=diff
> ==============================================================================
> --- llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp (original)
> +++ llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp Wed Jan 24 16:18:52 2018
> @@ -2488,6 +2488,7 @@ void RuleMatcher::emit(MatchTable &Table
> 
>   Table << MatchTable::Opcode("GIR_Done", -1) << MatchTable::LineBreak
>         << MatchTable::Label(LabelID);
> +  ++NumPatternEmitted;
> }
> 
> bool RuleMatcher::isHigherPriorityThan(const RuleMatcher &B) const {
> @@ -3949,10 +3950,9 @@ void GlobalISelEmitter::run(raw_ostream
>                          : InputRules;
> 
>   MatchTable Table(0);
> -  for (Matcher *Rule : OptRules) {
> +  for (Matcher *Rule : OptRules)
>     Rule->emit(Table);
> -    ++NumPatternEmitted;
> -  }
> +
>   Table << MatchTable::Opcode("GIM_Reject") << MatchTable::LineBreak;
>   Table.emitDeclaration(OS);
>   OS << "  if (executeMatchTable(*this, OutMIs, State, ISelInfo, ";
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list