Skip to content

Commit

Permalink
SDAG: Avoid relying on the return value of SelectCode in Hexagon. NFC
Browse files Browse the repository at this point in the history
This is a bit of a spot fix for now. I'll try to fix this up more
comprehensively soon.

This is part of the work to have Select return void instead of an
SDNode *, which is in turn part of llvm.org/pr26808.

llvm-svn: 269112
  • Loading branch information
bogner committed May 10, 2016
1 parent 7d6e81d commit dcb7a82
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,13 @@ SDNode *HexagonDAGToDAGISel::StoreInstrForLoadIntrinsic(MachineSDNode *LoadN,
else
TS = CurDAG->getTruncStore(SDValue(LoadN,2), dl, SDValue(LoadN,0), Loc, PI,
MVT::getIntegerVT(Size*8), false, false, Size);
SDNode *StoreN = SelectStore(TS.getNode());

SDNode *StoreN;
{
HandleSDNode Handle(TS);
SelectStore(TS.getNode());
StoreN = Handle.getValue().getNode();
}

// Load's results are { Loaded value, Updated pointer, Chain }
ReplaceUses(SDValue(IntN, 0), SDValue(LoadN, 1));
Expand Down Expand Up @@ -720,7 +726,8 @@ SDNode *HexagonDAGToDAGISel::SelectIndexedStore(StoreSDNode *ST, SDLoc dl) {

ReplaceUses(ST, Result);
ReplaceUses(SDValue(ST,1), SDValue(Result,1));
return Result;
CurDAG->RemoveDeadNode(ST);
return nullptr;
}

// Note: Order of operands matches the def of instruction:
Expand Down Expand Up @@ -767,7 +774,8 @@ SDNode *HexagonDAGToDAGISel::SelectIndexedStore(StoreSDNode *ST, SDLoc dl) {

ReplaceUses(SDValue(ST,0), SDValue(Result_2,0));
ReplaceUses(SDValue(ST,1), SDValue(Result_1,0));
return Result_2;
CurDAG->RemoveDeadNode(ST);
return nullptr;
}

SDNode *HexagonDAGToDAGISel::SelectStore(SDNode *N) {
Expand Down

0 comments on commit dcb7a82

Please sign in to comment.