[PATCH] D38440: [InstCombine] Use APInt for all the math in foldICmpDivConstant

David Majnemer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 30 16:05:53 PDT 2017


majnemer added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineCompares.cpp:61-71
-  if (VectorType *VTy = dyn_cast<VectorType>(In1->getType())) {
-    for (unsigned i = 0, e = VTy->getNumElements(); i != e; ++i) {
-      Constant *Idx = ConstantInt::get(Type::getInt32Ty(In1->getContext()), i);
-      if (hasAddOverflow(extractElement(Result, Idx),
-                         extractElement(In1, Idx),
-                         extractElement(In2, Idx),
-                         IsSigned))
----------------
This appears to handle non-splat vectors. Does the new code achieve the same result?


https://reviews.llvm.org/D38440





More information about the llvm-commits mailing list