[PATCH] SimplifyCFG: turn recursive GatherConstantCompares into iterative

Michael Ilseman milseman at apple.com
Wed Nov 19 20:42:27 PST 2014


The git-diff got a little convoluted in it’s +'s and -'s, so I’ll trust that you kept the functionality the same.

+  /// Don't want to copy this
+  ConstantComparesGatherer(const ConstantComparesGatherer &) = delete;
+

If that’s the case, you also probably want to delete the assignment operator.

+  bool match(Instruction *I, const DataLayout *DL, bool isEQ) {

Especially given that “match" now conflicts with the match from PatternMatchers.h, is there a more descriptive name? I believe this does matching as well as comparison with an optional CompValue.

All in all, I think this switch to a struct and methods is an improvement over the many parameters and state that were there previously. LGTM.


> On Nov 19, 2014, at 8:00 PM, Mehdi Amini <mehdi.amini at apple.com> wrote:
> 
> <0001-SimplifyCFG-Refactor-GatherConstantCompares-result-i.patch>





More information about the llvm-commits mailing list