[PATCH] D69842: [InstCombine] canonicalize shift+logic+shift to reduce dependency chain

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 6 07:13:13 PST 2019


spatel added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp:304-305
+static Instruction *foldShiftOfShiftedLogic(BinaryOperator &I,
+                                            InstCombiner::BuilderTy &Builder) {
+  auto *LogicInst = dyn_cast<BinaryOperator>(I.getOperand(0));
+  if (!LogicInst || !LogicInst->isBitwiseLogicOp() || !LogicInst->hasOneUse())
----------------
lebedev.ri wrote:
> Do you want to assert that `I` (and thus the inner 'shift') is actually a shift?
Sure - more asserts are good.


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

https://reviews.llvm.org/D69842





More information about the llvm-commits mailing list