diff options
author | Sjoerd Meijer <sjoerd.meijer@arm.com> | 2020-01-14 16:00:59 +0000 |
---|---|---|
committer | Sjoerd Meijer <sjoerd.meijer@arm.com> | 2020-01-14 16:10:55 +0000 |
commit | a08c0adee072226179736c4f6caf3dd0b7a7c9af (patch) | |
tree | 354d4b69b30b4aa22e73230687f5ef8cc941cd60 /llvm/lib | |
parent | 013c07f697886649b068cd97127e528b4fe7c03e (diff) | |
download | bcm5719-llvm-a08c0adee072226179736c4f6caf3dd0b7a7c9af.tar.gz bcm5719-llvm-a08c0adee072226179736c4f6caf3dd0b7a7c9af.zip |
[ARM][MVE] VTP Block Pass fix
Fix a missing and broken test: 2 VPT blocks predicated on the same VCMP
instruction that can be folded. The problem was that for each VPT block, we
record the predicate statements with a list, but the same instruction was added
twice. Thus, we were running in an assert trying to remove the same instruction
twice. To avoid this the instructions are now recorded with a set.
Differential Revision: https://reviews.llvm.org/D72699
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/ARM/MVEVPTBlockPass.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/MVEVPTBlockPass.cpp b/llvm/lib/Target/ARM/MVEVPTBlockPass.cpp index 19d34fd275d..a5df46c94f4 100644 --- a/llvm/lib/Target/ARM/MVEVPTBlockPass.cpp +++ b/llvm/lib/Target/ARM/MVEVPTBlockPass.cpp @@ -96,7 +96,7 @@ bool MVEVPTBlock::InsertVPTBlocks(MachineBasicBlock &Block) { bool Modified = false; MachineBasicBlock::instr_iterator MBIter = Block.instr_begin(); MachineBasicBlock::instr_iterator EndIter = Block.instr_end(); - SmallVector<MachineInstr *, 4> RemovedVCMPs; + SmallSet<MachineInstr *, 4> RemovedVCMPs; while (MBIter != EndIter) { MachineInstr *MI = &*MBIter; @@ -154,7 +154,7 @@ bool MVEVPTBlock::InsertVPTBlocks(MachineBasicBlock &Block) { // and deleting all instructions in this list in one go after we have // created the VPT blocks. We do this in order not to invalidate the // ReachingDefAnalysis that is queried by 'findVCMPToFoldIntoVPST'. - RemovedVCMPs.push_back(VCMP); + RemovedVCMPs.insert(VCMP); } else { MIBuilder = BuildMI(Block, MI, dl, TII->get(ARM::MVE_VPST)); MIBuilder.addImm(BlockMask); |