[llvm] 09e0aea - [AMDGPU] Use std::optional in SIPeepholeSDWA.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 25 22:40:06 PST 2022
Author: Kazu Hirata
Date: 2022-11-25T22:40:00-08:00
New Revision: 09e0aeaaaaff2d18bb5f87b99e752e32756f5a33
URL: https://github.com/llvm/llvm-project/commit/09e0aeaaaaff2d18bb5f87b99e752e32756f5a33
DIFF: https://github.com/llvm/llvm-project/commit/09e0aeaaaaff2d18bb5f87b99e752e32756f5a33.diff
LOG: [AMDGPU] Use std::optional in SIPeepholeSDWA.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/SIPeepholeSDWA.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp b/llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp
index b623d6eaa118..006760fb7646 100644
--- a/llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp
+++ b/llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp
@@ -25,6 +25,7 @@
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
+#include <optional>
using namespace llvm;
@@ -691,7 +692,8 @@ SIPeepholeSDWA::matchSDWAOperand(MachineInstr &MI) {
// to SDWA preserve dst:v4 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE preserve:v3
// Check if one of operands of v_or_b32 is SDWA instruction
- using CheckRetType = Optional<std::pair<MachineOperand *, MachineOperand *>>;
+ using CheckRetType =
+ std::optional<std::pair<MachineOperand *, MachineOperand *>>;
auto CheckOROperandsForSDWA =
[&](const MachineOperand *Op1, const MachineOperand *Op2) -> CheckRetType {
if (!Op1 || !Op1->isReg() || !Op2 || !Op2->isReg())
More information about the llvm-commits
mailing list