[PATCH] D73883: HexagonOptAddrMode::changeStore - fix null dereference warning (PR43463)
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 3 08:59:55 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGbdfcdb1fb3f4: HexagonOptAddrMode::changeStore - fix null dereference warning (PR43463) (authored by RKSimon).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73883/new/
https://reviews.llvm.org/D73883
Files:
llvm/lib/Target/Hexagon/HexagonOptAddrMode.cpp
Index: llvm/lib/Target/Hexagon/HexagonOptAddrMode.cpp
===================================================================
--- llvm/lib/Target/Hexagon/HexagonOptAddrMode.cpp
+++ llvm/lib/Target/Hexagon/HexagonOptAddrMode.cpp
@@ -561,6 +561,7 @@
MIB.add(ImmOp);
MIB.add(OldMI->getOperand(3));
OpStart = 4;
+ Changed = true;
} else if (HII->getAddrMode(*OldMI) == HexagonII::BaseImmOffset) {
short NewOpCode = HII->changeAddrMode_io_abs(*OldMI);
assert(NewOpCode >= 0 && "Invalid New opcode\n");
@@ -570,10 +571,8 @@
MIB.addGlobalAddress(GV, Offset, ImmOp.getTargetFlags());
MIB.add(OldMI->getOperand(2));
OpStart = 3;
+ Changed = true;
}
- Changed = true;
- LLVM_DEBUG(dbgs() << "[Changing]: " << *OldMI << "\n");
- LLVM_DEBUG(dbgs() << "[TO]: " << *MIB << "\n");
} else if (ImmOpNum == 1 && OldMI->getOperand(2).getImm() == 0) {
short NewOpCode = HII->changeAddrMode_rr_io(*OldMI);
assert(NewOpCode >= 0 && "Invalid New opcode\n");
@@ -582,12 +581,14 @@
MIB.add(ImmOp);
OpStart = 3;
Changed = true;
+ }
+ if (Changed) {
LLVM_DEBUG(dbgs() << "[Changing]: " << *OldMI << "\n");
LLVM_DEBUG(dbgs() << "[TO]: " << *MIB << "\n");
- }
- if (Changed)
+
for (unsigned i = OpStart; i < OpEnd; ++i)
MIB.add(OldMI->getOperand(i));
+ }
return Changed;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73883.242102.patch
Type: text/x-patch
Size: 1386 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200203/ca0ca596/attachment.bin>
More information about the llvm-commits
mailing list