reactorlabs/rir

sequences starting with non-constant value

オープン

#789 opened on 2020/01/22

 (3 件のコメント) (0 件のリアクション) (0 人の担当者)C++ (19 件のフォーク)github user discovery
enhancementgood first issuehelp wantedpir

Repository metrics

Stars
 (61 個のスター)
PR merge metrics
 (平均マージ 1m) (30d で 1 merged PR)

説明

For some reason in https://github.com/reactorlabs/rir/blob/master/rir/src/ir/Compiler.cpp#L238 we only properly compile a simple for loop for (i in a:b) if a is a numerical constant.

This causes us to allocate lots of unnecessary vectors (e.g. in nbody_naive_2).

I suspect that this is a hack, exploiting the fact that a < b happens to error similarly to a:b if a is a number.

This should be fixable quite easily by emitting a check for the type of a ensuring that it is compatible with : first.

コントリビューターガイド