Instruction selection will insert nodes into the underlying list after the root node and iterating will thereby miss it. We should NOT assume that, the root node is the last element in the DAG nodelist.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
I'll let Hal chime in here, but I'd prefer if we just refactor this code to use a range-for instead of this while loop (in all 3 cases).
Comment Actions
Hi, Nemanjai, if change it to the rangefor, we will walk the DAG in the reverse order(begin() -> end()), which result in two case failed. CodeGen/PowerPC/cmpb.ll and CodeGen/PowerPC/cmpb-ppc32.ll. It seems that, our implementation has some dependent on how we walk the DAG.
Comment Actions
I would as well, but I don't think that we can here. The range over which we're iterating is being modified as we do it. In any case, if we're going to try to change this, I'd do it in two stages. First, this change (so we know that we're hitting everything). Then look at trying to simplify the iteration structure. This LGTM.