Skip to content

Commit

Permalink
[SelectionDAG][VP] Fix MemSDNode::getBasePtr
Browse files Browse the repository at this point in the history
Found while working on D108987. When interpreting VP nodes as
`MemSDNode` nodes, this function would return the incorrect indices.
This was due to `VP_GATHER` and having no "passthru", and both
`VP_GATHER` and `VP_SCATTER` having their mask operands *after* the base
pointer, unlike `MGATHER` and `MSCATTER`.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D109308
  • Loading branch information
frasercrmck committed Sep 7, 2021
1 parent ffcaa80 commit a40599c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions llvm/include/llvm/CodeGen/SelectionDAGNodes.h
Expand Up @@ -1363,11 +1363,10 @@ class MemSDNode : public SDNode {
case ISD::STORE:
case ISD::VP_STORE:
case ISD::MSTORE:
case ISD::VP_SCATTER:
return getOperand(2);
case ISD::MGATHER:
case ISD::MSCATTER:
case ISD::VP_GATHER:
case ISD::VP_SCATTER:
return getOperand(3);
default:
return getOperand(1);
Expand Down

0 comments on commit a40599c

Please sign in to comment.