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

Diogo N. Sampaio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 4 09:09:02 PST 2019


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.
----------------
dnsampaio wrote:
> 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.
Oh, I see that when creating these operands we only allow constant values. And trying llvm-mc it confirms it so. Sorry, did not get the suggestion. :)


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

https://reviews.llvm.org/D56098





More information about the llvm-commits mailing list