[PATCH] D90935: [ARM][LowOverheadLoops] Merge VCMP and VPST across VPT blocks
Dave Green via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 6 07:02:33 PST 2020
dmgreen added a comment.
Is it possible to write some tests that are hopefully simple but still tail predicated, and contain different kinds of vpt blocks with various instructions in various orders? It probably doesn't matter if the instructions are super sensible so long as they show the different sets of blocks with vcmps followed by predicated/unpredicated instructions.
================
Comment at: llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp:1564
// with the VPST This should be the divergent instruction
- MachineInstr *VCMP =
- VCMPOpcodeToVPT(Divergent->getOpcode()) != 0 ? Divergent : nullptr;
-
- auto ReplaceVCMPWithVPT = [&]() {
- // Replace the VCMP with a VPT
- MachineInstrBuilder MIB = BuildMI(
- *Divergent->getParent(), Divergent, Divergent->getDebugLoc(),
- TII->get(VCMPOpcodeToVPT(VCMP->getOpcode())));
- MIB.addImm(ARMVCC::Then);
- // Register one
- MIB.add(VCMP->getOperand(1));
- // Register two
- MIB.add(VCMP->getOperand(2));
- // The comparison code, e.g. ge, eq, lt
- MIB.add(VCMP->getOperand(3));
- LLVM_DEBUG(dbgs()
- << "ARM Loops: Combining with VCMP to VPT: " << *MIB);
- LoLoop.BlockMasksToRecompute.insert(MIB.getInstr());
- LoLoop.ToRemove.insert(VCMP);
- };
+ VCMP = VCMPOpcodeToVPT(Divergent->getOpcode()) != 0 ? Divergent : VCMP;
----------------
I think we need to make sure this _is_ the last instruction in the block. Otherwise we can't remove it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D90935/new/
https://reviews.llvm.org/D90935
More information about the llvm-commits
mailing list