[PATCH] D50823: [VPlan] Introduce VPCmpInst sub-class in the instruction-level representation

Diego Caballero via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 17 09:24:18 PDT 2018


dcaballe added inline comments.


================
Comment at: lib/Transforms/Vectorize/LoopVectorizationPlanner.h:157
+    assert(CI && "CI can't be null!");
+    assert(LeftOp && RightOp && "VPCmpInst's operands can't be null!");
+    VPCmpInst *VPCI = createCmpInst(LeftOp, RightOp, CI->getPredicate());
----------------
rkruppe wrote:
> This duplicates the assertion in the other overload that's called in the next line, right? I don't mind that, it's good to be a bit more defensive, just want to make sure I didn't miss anything and that this is intentional.
Thanks, Robin. IIRC, the initial implementation didn't invoke the overload. I agree with what you said. It's better to be defensive, just in case the implementation of this one ends up not invoking the overload again.


Repository:
  rL LLVM

https://reviews.llvm.org/D50823





More information about the llvm-commits mailing list