[PATCH] Small refactor on VectorizerHint for deduplication

Arnold Schwaighofer aschwaighofer at apple.com
Sun Aug 17 10:58:53 PDT 2014


Hi Renato,

This LGTM. I have only minor stylistic comments:

I think this would reads easier if we refer to Hint and Hints instead of HintType(s).

We concatenate and split "llvm.loop" and "vectorize.foo". I think it would simplify the code if the Hints refer to the full string?

Can we centralize the logic if we move the validation logic into a member function "validate" that switches on a hint kind? Validation and the hint are intrinsically connected.

  struct Hint {
   enum Kind {
    kUnroll, ...} HintKind;

    Hint(Kind K, StringRef Name...) {}

    bool validate() {
     switch(HintKind) { 
        case kUnroll:
     }
   }
  };

Thanks for fixing this.

http://reviews.llvm.org/D4913






More information about the llvm-commits mailing list