[PATCH] D89628: Fix constant-folding of overflowing arithmetic ops on vectors

LemonBoy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 31 10:15:51 PDT 2020


LemonBoy added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:4582-4584
+  Type *OverflowTy = Type::getInt1Ty(LHS->getContext());
+  if (auto *LHSTy = dyn_cast<VectorType>(LHS->getType()))
+    OverflowTy = VectorType::get(OverflowTy, LHSTy->getElementCount());
----------------
majnemer wrote:
> I think this can be simplified to `CmpInst::makeCmpResultType(LHS->getType())`
Yup, I didn't use that because this is not the result of a comparison despite having the same type as one.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89628/new/

https://reviews.llvm.org/D89628



More information about the llvm-commits mailing list