[llvm] ebe3281 - [AMDGPU] Use std::optional in AMDGPUReleaseVGPRs.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 25 22:30:32 PST 2022
Author: Kazu Hirata
Date: 2022-11-25T22:30:26-08:00
New Revision: ebe32817935515c57c241bf58d7d3c0d7bc31420
URL: https://github.com/llvm/llvm-project/commit/ebe32817935515c57c241bf58d7d3c0d7bc31420
DIFF: https://github.com/llvm/llvm-project/commit/ebe32817935515c57c241bf58d7d3c0d7bc31420.diff
LOG: [AMDGPU] Use std::optional in AMDGPUReleaseVGPRs.cpp (NFC)
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPUReleaseVGPRs.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUReleaseVGPRs.cpp b/llvm/lib/Target/AMDGPU/AMDGPUReleaseVGPRs.cpp
index c53e262d23df..965b309a25f7 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUReleaseVGPRs.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUReleaseVGPRs.cpp
@@ -19,6 +19,7 @@
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineOperand.h"
+#include <optional>
using namespace llvm;
#define DEBUG_TYPE "release-vgprs"
@@ -46,7 +47,8 @@ class AMDGPUReleaseVGPRs : public MachineFunctionPass {
class LastVGPRUseIsVMEMStore {
BitVector BlockVMEMStore;
- static Optional<bool> lastVGPRUseIsStore(const MachineBasicBlock &MBB) {
+ static std::optional<bool>
+ lastVGPRUseIsStore(const MachineBasicBlock &MBB) {
for (auto &MI : reverse(MBB.instrs())) {
// If it's a VMEM store, a VGPR will be used, return true.
if ((SIInstrInfo::isVMEM(MI) || SIInstrInfo::isFLAT(MI)) &&
More information about the llvm-commits
mailing list