[PATCH] D50765: [TargetLowering] Add support for non-uniform vectors to BuildSDIV

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 16 10:27:10 PDT 2018


RKSimon added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/TargetLowering.cpp:3530-3531
+  auto BuildSDIVPattern = [&](ConstantSDNode *C) {
+    if (C->isNullValue())
+      return false;
+
----------------
lebedev.ri wrote:
> We will end up with improperly-sized/indexed arrays.
> I understand that `/ 0` is ub, but i wonder if we should be more proactive in failing?
> Perhaps we should push `0, 0, 0` to the vectors. Or maybe the current way is sufficient.
Any division by zero (even if its just one element in a vector) results in UNDEF - but we don't want to handle it here - so we just bail and leave DAGCombiner's simplifyDivRem to handle it.


Repository:
  rL LLVM

https://reviews.llvm.org/D50765





More information about the llvm-commits mailing list