Currently integer comparisons only.
Correctly optimizes this example file: https://ghostbin.com/paste/g382s
Paths
| Differential D22076
GVN: If X > Y is true, then replace X == Y with false and X != Y with true Needs ReviewPublic Authored by aarzee on Jul 6 2016, 5:24 PM. This revision needs review, but all specified reviewers are disabled or inactive.
Details
Summary Currently integer comparisons only. Correctly optimizes this example file: https://ghostbin.com/paste/g382s
Diff Detail Event TimelineComment Actions Yes, create a function for it. And in general, assume the answer to "should I create a function for this" is yes. Comment Actions Outline replacement of instruction with constant. If X == Y is true, replace X >= Y with true and X > Y with false.
Revision Contents
Diff 70348 include/llvm/Transforms/Scalar/GVN.h
lib/Transforms/Scalar/GVN.cpp
|
This needs to be factored into a helper function of some sort, or something.
Adding 100 lines of dense duplicated code is ... bad :)