[llvm] [AMDGPU] Use std::optional in InstCombine of amdgcn_fmed3. NFC. (PR #108223)
Shilei Tian via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 11 06:45:48 PDT 2024
================
@@ -353,23 +353,20 @@ bool GCNTTIImpl::canSimplifyLegacyMulToMul(const Instruction &I,
}
/// Match an fpext from half to float, or a constant we can convert.
-static bool matchFPExtFromF16(Value *Arg, Value *&FPExtSrc) {
- if (match(Arg, m_OneUse(m_FPExt(m_Value(FPExtSrc)))))
- return FPExtSrc->getType()->isHalfTy();
-
+static std::optional<Value *> matchFPExtFromF16(Value *Arg) {
+ Value *Src;
----------------
shiltian wrote:
I understand here you just follow existing code, but I'd just initialize them to `nullptr`.
https://github.com/llvm/llvm-project/pull/108223
More information about the llvm-commits
mailing list