CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
89 lines
3.7 KiB
C++
89 lines
3.7 KiB
C++
//===- AArch64GlobalISelUtils.h ----------------------------------*- C++ -*-==//
|
|
//
|
|
// 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
/// \file APIs for AArch64-specific helper functions used in the GlobalISel
|
|
/// pipeline.
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_LIB_TARGET_AARCH64_GISEL_AARCH64GLOBALISELUTILS_H
|
|
#define LLVM_LIB_TARGET_AARCH64_GISEL_AARCH64GLOBALISELUTILS_H
|
|
#include "MCTargetDesc/AArch64AddressingModes.h"
|
|
#include "Utils/AArch64BaseInfo.h"
|
|
#include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
|
|
#include "llvm/CodeGen/GlobalISel/Utils.h"
|
|
#include "llvm/CodeGen/Register.h"
|
|
#include "llvm/IR/InstrTypes.h"
|
|
#include <cstdint>
|
|
|
|
namespace llvm {
|
|
|
|
namespace AArch64GISelUtils {
|
|
|
|
/// \returns true if \p C is a legal immediate operand for an arithmetic
|
|
/// instruction.
|
|
constexpr bool isLegalArithImmed(const uint64_t C) {
|
|
return (C >> 12 == 0) || ((C & 0xFFFULL) == 0 && C >> 24 == 0);
|
|
}
|
|
|
|
/// \returns A value when \p MI is a vector splat of a Register or constant.
|
|
/// Checks for generic opcodes and AArch64-specific generic opcodes.
|
|
std::optional<RegOrConstant>
|
|
getAArch64VectorSplat(const MachineInstr &MI, const MachineRegisterInfo &MRI);
|
|
|
|
/// \returns A value when \p MI is a constant vector splat.
|
|
/// Checks for generic opcodes and AArch64-specific generic opcodes.
|
|
std::optional<int64_t>
|
|
getAArch64VectorSplatScalar(const MachineInstr &MI,
|
|
const MachineRegisterInfo &MRI);
|
|
|
|
/// \returns true if \p MaybeSub and \p Pred are part of a CMN tree for an
|
|
/// integer compare.
|
|
bool isCMN(const MachineInstr *MaybeSub, const CmpInst::Predicate &Pred,
|
|
const MachineRegisterInfo &MRI);
|
|
|
|
/// Replace a G_MEMSET with a value of 0 with a G_BZERO instruction if it is
|
|
/// supported and beneficial to do so.
|
|
///
|
|
/// \note This only applies on Darwin.
|
|
///
|
|
/// \returns true if \p MI was replaced with a G_BZERO.
|
|
bool tryEmitBZero(MachineInstr &MI, MachineIRBuilder &MIRBuilder,
|
|
const LibcallLoweringInfo &Libcalls, bool MinSize);
|
|
|
|
/// Analyze a ptrauth discriminator value to try to find the constant integer
|
|
/// and address parts, cracking a ptrauth_blend intrinsic if there is one.
|
|
/// \returns integer/address disc. parts, with NoRegister if no address disc.
|
|
std::tuple<uint16_t, Register>
|
|
extractPtrauthBlendDiscriminators(Register Disc, MachineRegisterInfo &MRI);
|
|
|
|
/// Find the AArch64 condition codes necessary to represent \p P for a scalar
|
|
/// floating point comparison.
|
|
///
|
|
/// \param [out] CondCode is the first condition code.
|
|
/// \param [out] CondCode2 is the second condition code if necessary.
|
|
/// AArch64CC::AL otherwise.
|
|
void changeFCMPPredToAArch64CC(const CmpInst::Predicate P,
|
|
AArch64CC::CondCode &CondCode,
|
|
AArch64CC::CondCode &CondCode2);
|
|
|
|
/// Find the AArch64 condition codes necessary to represent \p P for a vector
|
|
/// floating point comparison.
|
|
///
|
|
/// \param [out] CondCode - The first condition code.
|
|
/// \param [out] CondCode2 - The second condition code if necessary.
|
|
/// AArch64CC::AL otherwise.
|
|
/// \param [out] Invert - True if the comparison must be inverted with a NOT.
|
|
void changeVectorFCMPPredToAArch64CC(const CmpInst::Predicate P,
|
|
AArch64CC::CondCode &CondCode,
|
|
AArch64CC::CondCode &CondCode2,
|
|
bool &Invert);
|
|
|
|
} // namespace AArch64GISelUtils
|
|
} // namespace llvm
|
|
|
|
#endif
|