Since testing the function indirectly is tricky, introduce a direct
print-memderefs pass, in the same spirit as print-memdeps, which prints
dereferenceability information matched by FileCheck.
Details
Diff Detail
Event Timeline
I'd suggest splitting this into two patches: adding the new analysis, adding the new optimization and testing it. If you really didn't want to for some reason, it's not that big a deal, but it would make it easier to review quickly.
include/llvm/IR/InstIterator.h | ||
---|---|---|
130 | I might call this inst_range. I'm usually not a fan of extra verbosity, but I see potential confusion resulting from a such short relatively common name being added to the llvm namespace. | |
lib/Analysis/MemDepPrinter.cpp | ||
147 | Please separate this refactoring into a separate change. | |
lib/Analysis/MemDerefPrinter.cpp | ||
1 | Please split the introduction of the printer and one or two example tests into it's own change. I'll be happy to LGTM that one quickly. | |
22 | Why do you need to capture F? | |
24 | Why is this enum needed? | |
43 | You should also clear your small vector. (I think) | |
lib/IR/Value.cpp | ||
575 | I'd suggest using isGCRelocate here. |
LGTM.
For future reference, I read your comment "Split print-memderefs into its own change." as meaning that you'd split the MemDerefPrinter into a separate review thread. Since the original semantic change (which I thought was this thread) was blocked on that, I deleted the email without looking further.
lib/Analysis/MemDerefPrinter.cpp | ||
---|---|---|
49 | It would be better to get the data layout if available and use it here. You'll get far more precise results. (This can be separate change if desired.) |
I might call this inst_range. I'm usually not a fan of extra verbosity, but I see potential confusion resulting from a such short relatively common name being added to the llvm namespace.