From c47a5fbb229bbdee30aeb4e5761e8c083f2fe680 Mon Sep 17 00:00:00 2001 From: Kewen12 Date: Wed, 21 May 2025 16:31:14 -0700 Subject: Revert "[llvm] add GenericFloatingPointPredicateUtils (#140254)" (#140968) This reverts commit d00d74bb2564103ae3cb5ac6b6ffecf7e1cc2238. The PR breaks our buildbots and blocks downstream merge. --- .../CodeGen/MachineFloatingPointPredicateUtils.cpp | 48 ---------------------- 1 file changed, 48 deletions(-) delete mode 100644 llvm/lib/CodeGen/MachineFloatingPointPredicateUtils.cpp (limited to 'llvm/lib/CodeGen/MachineFloatingPointPredicateUtils.cpp') diff --git a/llvm/lib/CodeGen/MachineFloatingPointPredicateUtils.cpp b/llvm/lib/CodeGen/MachineFloatingPointPredicateUtils.cpp deleted file mode 100644 index 3f640de..0000000 --- a/llvm/lib/CodeGen/MachineFloatingPointPredicateUtils.cpp +++ /dev/null @@ -1,48 +0,0 @@ -//===- MachineFloatingPointPredicateUtils.cpp -----------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "llvm/CodeGen/MachineFloatingPointPredicateUtils.h" -#include "llvm/CodeGen/GlobalISel/MIPatternMatch.h" -#include "llvm/CodeGen/LowLevelTypeUtils.h" -#include "llvm/CodeGen/MachineRegisterInfo.h" -#include "llvm/CodeGen/MachineSSAContext.h" -#include "llvm/IR/Constants.h" -#include - -namespace llvm { - -using namespace MIPatternMatch; - -template <> -DenormalMode -MachineFloatingPointPredicateUtils::queryDenormalMode(const MachineFunction &MF, - Register Val) { - const MachineRegisterInfo &MRI = MF.getRegInfo(); - LLT Ty = MRI.getType(Val).getScalarType(); - return MF.getDenormalMode(getFltSemanticForLLT(Ty)); -} - -template <> -bool MachineFloatingPointPredicateUtils::lookThroughFAbs( - const MachineFunction &MF, Register LHS, Register &Src) { - const MachineRegisterInfo &MRI = MF.getRegInfo(); - return mi_match(LHS, MRI, m_GFabs(m_Reg(Src))); -} - -template <> -std::optional MachineFloatingPointPredicateUtils::matchConstantFloat( - const MachineFunction &MF, Register Val) { - const MachineRegisterInfo &MRI = MF.getRegInfo(); - const ConstantFP *ConstVal; - if (mi_match(Val, MRI, m_GFCst(ConstVal))) - return ConstVal->getValueAPF(); - - return std::nullopt; -} - -} // namespace llvm -- cgit v1.1