From 79debc50372ce12eae471bdea0013a2df299c598 Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Fri, 6 Apr 2018 18:19:22 +0000 Subject: [Hexagon] Fix assert with packetizing IMPLICIT_DEF instructions The compiler is generating packet with the following instructions, which causes an undefined register assert in the verifier. $r0 = IMPLICIT_DEF $r1 = IMPLICIT_DEF S2_storerd_io killed $r29, 0, killed %d0 The problem is that the packetizer is not saving the IMPLICIT_DEF instructions, which are needed when checking if it is legal to add the store instruction. The fix is to add the IMPLICIT_DEF instructions to the CurrentPacketMIs structure. Patch by Brendon Cahoon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329439 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Hexagon/HexagonVLIWPacketizer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/Target/Hexagon/HexagonVLIWPacketizer.cpp') diff --git a/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp b/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp index f8cfa09baba..8c528b9ed22 100644 --- a/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp +++ b/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp @@ -1687,8 +1687,12 @@ HexagonPacketizerList::addToPacket(MachineInstr &MI) { PacketStalls = false; PacketStalls |= producesStall(MI); - if (MI.isImplicitDef()) + if (MI.isImplicitDef()) { + // Add to the packet to allow subsequent instructions to be checked + // properly. + CurrentPacketMIs.push_back(&MI); return MII; + } assert(ResourceTracker->canReserveResources(MI)); bool ExtMI = HII->isExtended(MI) || HII->isConstExtended(MI); -- cgit v1.2.3