[PATCH] D56098: [ARM] Teach ComputeKnownBitsTarget to handle extract vectors

Diogo N. Sampaio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 29 09:36:25 PST 2018


dnsampaio marked an inline comment as done.
dnsampaio added inline comments.


================
Comment at: lib/Target/ARM/ARMISelLowering.cpp:13643
+    ConstantSDNode *Pos = dyn_cast<ConstantSDNode>(Op.getOperand(1).getNode());
+    if (Pos && Pos->getAPIntValue().ult(NumSrcElts)) {
+      // If we know the element index, just demand that vector element.
----------------
sbaranga wrote:
> I think this test should always evaluate to true. Maybe it should be an assert?
Don't know. Can't Pos be nullptr? That is, the position is not a constant value? (vector[variableX] ?)
if (Pos >= NumSrcElts), perhaps I could just consider it a poison and return as a value zero.


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

https://reviews.llvm.org/D56098





More information about the llvm-commits mailing list