Details
- Reviewers
tejohnson - Commits
- rGc85055b20392: [Assembler] Emit summary index flags
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/IR/AsmWriter.cpp | ||
---|---|---|
754 | Looking at SlotTracker::processIndex, I think it could be improved and we can compute this there. For clarity, that method should probably iterate the typeIdCompatibleVtableMap before setting TypeIdNext (although the typeIdCompatibleVtable and the typeId summaries are mutually exclusive, I think it would be clearer to do it in that order). Then we could add something like a "IndexSlot" variable that can be set to TypeIdNext at the end. I think that will make it more clear what needs to change if we later need to add an additional type of slot. | |
2746 | The EnableSplitLTOUnit flag will be set on per-module summaries. In which case I think this does the right thing, since it will be non-zero. But the comment seems wrong. |
Addressed comments
Looking at SlotTracker::processIndex, I think it could be improved and we can compute this there. For clarity, that method should probably iterate the typeIdCompatibleVtableMap before setting TypeIdNext (although the typeIdCompatibleVtable and the typeId summaries are mutually exclusive, I think it would be clearer to do it in that order). Then we could add something like a "IndexSlot" variable that can be set to TypeIdNext at the end.
Makes sense but I don't think we need an extra variable. We can simply use TypeIdNext, as it will be equal to number of slots in both combined and per-module summaries.
Looking at SlotTracker::processIndex, I think it could be improved and we can compute this there. For clarity, that method should probably iterate the typeIdCompatibleVtableMap before setting TypeIdNext (although the typeIdCompatibleVtable and the typeId summaries are mutually exclusive, I think it would be clearer to do it in that order). Then we could add something like a "IndexSlot" variable that can be set to TypeIdNext at the end. I think that will make it more clear what needs to change if we later need to add an additional type of slot.