[PATCH] D30211: [LV] Merge floating point and integer induction widening code

Michael Kuperstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 22 13:04:07 PST 2017


mkuper added inline comments.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:400
+static Constant *getIntOrFpConstant(Type *Ty, unsigned C) {
+  return Ty->isIntegerTy() ? ConstantInt::get(Ty, C) : ConstantFP::get(Ty, C);
+}
----------------
mssimpso wrote:
> mkuper wrote:
> > mssimpso wrote:
> > > mkuper wrote:
> > > > One of the users of this for the int case was a getSigned(), and now it's a get(). Are you sure this is correct?
> > > You're right, nice catch!
> > So you're saying the get() on line 2592 should have been a getSigned() too?
> > (Although I'm not sure it matters, for that case.)
> Both of the original uses (get and getSigned) could only ever have values greater than one (and much less than the max int64_t) so I don't think it makes a difference either way. If we go with a helper function here, I think the signed version is less confusing.
Yeah, makes sense.


https://reviews.llvm.org/D30211





More information about the llvm-commits mailing list