[PATCH] D74484: [AggressiveInstCombine] Add support for ICmp instr that feeds a select intsr's condition operand.

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 13 22:34:37 PST 2020


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp:348-349
+static bool isConstOrExtFitInType(Value *V, Type *Ty, bool IsSigned = true) {
+  if (ConstantInt *C = dyn_cast<ConstantInt>(V))
+    return Ty->getIntegerBitWidth() >= getConstMinBitWidth(IsSigned, C);
+
----------------
Wait, why are we giving up on non-scalars here?
See how e.g. `Constant::isAllOnesValue()` handles different types,
i think similar recursion should be done here.


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

https://reviews.llvm.org/D74484





More information about the llvm-commits mailing list