reactorlabs/rir

sequences starting with non-constant value

开放

#789 创建于 2020年1月22日

 (3 条评论) (0 个反应) (0 位负责人)C++ (19 个派生)github user discovery
enhancementgood first issuehelp wantedpir

仓库指标

星标
 (61 个星标)
PR 合并指标
 (平均合并 1分钟) (30 天内合并 1 个 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.

贡献者指南