[PATCH] D101357: [CodeGen][AArch64][SVE] Fold [rdffr, ptest] => rdffrs; bugfix for optimizePTestInstr
Peter Waller via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 12 04:31:20 PDT 2021
peterwaller-arm marked 2 inline comments as done.
peterwaller-arm added a comment.
Found and fixed additional bug here.
================
Comment at: llvm/lib/Target/AArch64/AArch64InstrInfo.cpp:1313-1321
+ const TargetRegisterInfo *TRI = &getRegisterInfo();
+
+ // If another instruction between the propagation and test sets the
+ // flags, don't remove the ptest.
+ MachineBasicBlock::iterator I = Pred, E = PTest;
+ ++I; // Skip past the predicate op itself.
+ for (; I != E; ++I)
----------------
paulwalker-arm wrote:
> I have no proof on this so feel free to ignore if you disagree.
>
> Hoisting the `Pred->getParent() != PTest->getParent()` part offers a faster route to termination so I'm good with that.
>
> However, I feel iterating across the BB's instructions may not and so that part might be better to keep until after we've decided `Mask` and `Pred` are interesting.
Opted to leave the code as is for now and change it in next patch.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101357/new/
https://reviews.llvm.org/D101357
More information about the llvm-commits
mailing list