Skip to content

Commit 5f3f45d

Browse files
LiaoXinglongKrzysztof Parzyszek
authored and
Krzysztof Parzyszek
committed
[Hexagon] Check isInstr() before getInstr() with SUnit
SUnit represent a MachineInstr in post-regalloc scheduling but SDNode in pre-regalloc scheduling. when pass -enable-hexagon-sdnode-sched to Hexagon backend with -O1 and above, this may cause an assertion failed. Fixes PR45194. Differential Revision: https://reviews.llvm.org/D76134
1 parent 5fc05c3 commit 5f3f45d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/Hexagon/HexagonSubtarget.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,11 @@ bool HexagonSubtarget::useAA() const {
318318
void HexagonSubtarget::adjustSchedDependency(SUnit *Src, int SrcOpIdx,
319319
SUnit *Dst, int DstOpIdx,
320320
SDep &Dep) const {
321-
MachineInstr *SrcInst = Src->getInstr();
322-
MachineInstr *DstInst = Dst->getInstr();
323321
if (!Src->isInstr() || !Dst->isInstr())
324322
return;
325323

324+
MachineInstr *SrcInst = Src->getInstr();
325+
MachineInstr *DstInst = Dst->getInstr();
326326
const HexagonInstrInfo *QII = getInstrInfo();
327327

328328
// Instructions with .new operands have zero latency.

0 commit comments

Comments
 (0)