Rip min/max pattern matching out of InstCombine and into ValueTracking.
This matching functionality is useful in more than just InstCombine, so
make it available in ValueTracking.
NFC.
Paths
| Differential D9294
Rip min/max pattern matching out of InstCombine and into ValueTracking.
ClosedPublic Authored by jmolloy on Apr 27 2015, 8:18 AM.
Details
Diff Detail
Event TimelineComment Actions Could the PatternMatch version of min/max idiom detection be recast in terms of this machinery? http://llvm.org/docs/doxygen/html/PatternMatch_8h_source.html#l00946 reames edited edge metadata. Comment ActionsLGTM. If you want to reframe things w/PatternMatch, feel free, but please do that in a second commit. Having the move be clearly NFC is worthwhile.
This revision is now accepted and ready to land.Apr 27 2015, 9:25 AM
Comment Actions Hi, I've landed this in r236998, but am keeping this defect open for now because of Gerolf's comment.
Revision Contents
Diff 24478 include/llvm/Analysis/ValueTracking.h
lib/Analysis/ValueTracking.cpp
lib/Transforms/InstCombine/InstCombineInternal.h
lib/Transforms/InstCombine/InstCombineSelect.cpp
|
There's no reason this has to be restricted to select. Given that, I'd remove it from the comment & naming.
p.s. w.r.t the term "pattern": Personally, I might have used "idiom", but I'm not sure the difference matters.
(edit - given you're just moving the naming from instcombine, please ignore the previous and do not change.)