diff options
| author | Kazu Hirata <kazu@google.com> | 2021-11-21 10:36:20 -0800 |
|---|---|---|
| committer | Kazu Hirata <kazu@google.com> | 2021-11-21 10:36:20 -0800 |
| commit | c133fb321f7ca6083ce15b6aa5bf89de6600e649 (patch) | |
| tree | 463bc5f40b817bcd621a4df03b1add92011a36ac | |
| parent | fc981cedea073519e25af04bcf85c50cb37cc2c9 (diff) | |
[CodeGen] Use llvm::is_contained (NFC)
| -rw-r--r-- | llvm/lib/CodeGen/LiveRangeEdit.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/LiveRangeEdit.cpp b/llvm/lib/CodeGen/LiveRangeEdit.cpp index d91ff734ad8f..f36c33e62da7 100644 --- a/llvm/lib/CodeGen/LiveRangeEdit.cpp +++ b/llvm/lib/CodeGen/LiveRangeEdit.cpp @@ -425,15 +425,8 @@ void LiveRangeEdit::eliminateDeadDefs(SmallVectorImpl<MachineInstr *> &Dead, // The new intervals would have to be spilled anyway so its not worth it. // Also they currently aren't spilled so creating them and not spilling // them results in incorrect code. - bool BeingSpilled = false; - for (unsigned i = 0, e = RegsBeingSpilled.size(); i != e; ++i) { - if (VReg == RegsBeingSpilled[i]) { - BeingSpilled = true; - break; - } - } - - if (BeingSpilled) continue; + if (llvm::is_contained(RegsBeingSpilled, VReg)) + continue; // LI may have been separated, create new intervals. LI->RenumberValues(); |
