Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
include/llvm/IR/BasicBlock.h | ||
---|---|---|
185 ↗ | (On Diff #142527) | I realize \brief is used throughout this header, but I do not think that is necessary anymore, because the Doxygen.cfg has AutoBrief on. |
include/llvm/IR/Instruction.h | ||
703 ↗ | (On Diff #142527) | I like how you made this a struct instead of just a variadic function. I was exploring a similar solution, as discussed in the aforementioned thread, but had ambiguity issues with the base case. Looks like you cracked that! I like this. I wonder if it makes more sense to push this up into Casting.h since it's as specific as isa<>. |
include/llvm/IR/BasicBlock.h | ||
---|---|---|
185 ↗ | (On Diff #142527) | Yes, please avoid \brief. |
I like the direction this is going in :).
I think having an API like 'instructions_no_debug' or similar in BasicBlock would make the interface friendlier. For one, it'd signal to readers that skipping debug intrinsics is an established pattern. Also, I think it would be easier to change if, e.g we wanted update all existing users of the API to skip lifetime intrinsics too.
lib/Transforms/IPO/PartialInlining.cpp | ||
---|---|---|
853 ↗ | (On Diff #142527) | I think this changes the inline cost of debug info intrinsics from InstrCost to 0. That seems like a correct and worthwhile change, but would probably be best to tackle in a follow-up patch. |
854 ↗ | (On Diff #142527) | Fwiw, I found the switch a little easier to read. I'm not sure it's a clear readability improvement to put these type checks into template parameters. |
+1
include/llvm/IR/BasicBlock.h | ||
---|---|---|
198 ↗ | (On Diff #142527) | Indirection through a function pointer may not be optimized away - may be worth baking this into a functor type? |
include/llvm/IR/BasicBlock.h | ||
---|---|---|
185 ↗ | (On Diff #142527) |
Challenge accepted. |
Thanks for the feedback! I'll add a instructionsNoDebug function. I tried to make skipInsts as flexible as possible, but I am not sure if the flexibility is really needed. Should I remove it for now?
include/llvm/IR/BasicBlock.h | ||
---|---|---|
198 ↗ | (On Diff #142527) | Will do |
unittests/IR/BasicBlockTest.cpp | ||
17 ↗ | (On Diff #142527) | I'll remove this. |
It should be possible to implement instructionsNoDebug succinctly without skipInsts, so I'd suggest removing it.
I think the is_{any,none}_of predicates could be generally useful, though. It'd make sense to add them as a follow-up.
The only problem with those functions is that we cannot reverse a filter_iterator at the moment, as needed for D45379. But I suppose that should be fixable too.
Thanks, lgtm as well. I sent out a patch to fix the issue with reversing filtered iterator ranges (https://reviews.llvm.org/D45792).