diff options
author | Nicholas Guy <nicholas.guy@arm.com> | 2020-09-28 16:49:41 +0100 |
---|---|---|
committer | Nicholas Guy <nicholas.guy@arm.com> | 2020-10-21 11:52:47 +0100 |
commit | 9a2d2bedb73058f22f4fea30fec14df8281638f5 (patch) | |
tree | 31d2845c55a9f37e947d2024d8b78f9925d2ae47 /llvm/lib/CodeGen/IfConversion.cpp | |
parent | bfc961aeb2d0e5a05bca7a894cbc4370f5e79a6a (diff) | |
download | llvm-9a2d2bedb73058f22f4fea30fec14df8281638f5.zip llvm-9a2d2bedb73058f22f4fea30fec14df8281638f5.tar.gz llvm-9a2d2bedb73058f22f4fea30fec14df8281638f5.tar.bz2 |
Add "SkipDead" parameter to TargetInstrInfo::DefinesPredicate
Some instructions may be removable through processes such as IfConversion,
however DefinesPredicate can not be made aware of when this should be considered.
This parameter allows DefinesPredicate to distinguish these removable instructions
on a per-call basis, allowing for more fine-grained control from processes like
ifConversion.
Renames DefinesPredicate to ClobbersPredicate, to better reflect it's purpose
Differential Revision: https://reviews.llvm.org/D88494
Diffstat (limited to 'llvm/lib/CodeGen/IfConversion.cpp')
-rw-r--r-- | llvm/lib/CodeGen/IfConversion.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/IfConversion.cpp b/llvm/lib/CodeGen/IfConversion.cpp index 1a5c5d6..d149f8c 100644 --- a/llvm/lib/CodeGen/IfConversion.cpp +++ b/llvm/lib/CodeGen/IfConversion.cpp @@ -751,7 +751,7 @@ bool IfConverter::CountDuplicatedInstructions( // A pred-clobbering instruction in the shared portion prevents // if-conversion. std::vector<MachineOperand> PredDefs; - if (TII->DefinesPredicate(*TIB, PredDefs)) + if (TII->ClobbersPredicate(*TIB, PredDefs, false)) return false; // If we get all the way to the branch instructions, don't count them. if (!TIB->isBranch()) @@ -1146,7 +1146,7 @@ void IfConverter::ScanInstructions(BBInfo &BBI, // FIXME: Make use of PredDefs? e.g. ADDC, SUBC sets predicates but are // still potentially predicable. std::vector<MachineOperand> PredDefs; - if (TII->DefinesPredicate(MI, PredDefs)) + if (TII->ClobbersPredicate(MI, PredDefs, true)) BBI.ClobbersPred = true; if (!TII->isPredicable(MI)) { |