llvm/llvm/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp

//===- LegalizerHelperTest.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 "GISelMITest.h"
#include "llvm/CodeGen/GlobalISel/LostDebugLocObserver.h"

usingnamespaceLegalizeActions;
usingnamespaceLegalizeMutations;
usingnamespaceLegalityPredicates;

namespace {

class DummyGISelObserver : public GISelChangeObserver {};

// Test G_ROTL/G_ROTR lowering.
TEST_F(AArch64GISelMITest, LowerRotates) {}

// Test G_ROTL/G_ROTR non-pow2 lowering.
TEST_F(AArch64GISelMITest, LowerRotatesNonPow2) {}

// Test vector G_ROTR lowering.
TEST_F(AArch64GISelMITest, LowerRotatesVector) {}

// Test CTTZ expansion when CTTZ_ZERO_UNDEF is legal or custom,
// in which case it becomes CTTZ_ZERO_UNDEF with select.
TEST_F(AArch64GISelMITest, LowerBitCountingCTTZ0) {}

// CTTZ expansion in terms of CTLZ
TEST_F(AArch64GISelMITest, LowerBitCountingCTTZ1) {}

// CTLZ scalar narrowing
TEST_F(AArch64GISelMITest, NarrowScalarCTLZ) {}

// CTTZ scalar narrowing
TEST_F(AArch64GISelMITest, NarrowScalarCTTZ) {}

// CTTZ expansion in terms of CTPOP
TEST_F(AArch64GISelMITest, LowerBitCountingCTTZ2) {}

// CTPOP widening.
TEST_F(AArch64GISelMITest, WidenBitCountingCTPOP1) {}

// Test a strange case where the result is wider than the source
TEST_F(AArch64GISelMITest, WidenBitCountingCTPOP2) {}

// CTTZ_ZERO_UNDEF expansion in terms of CTTZ
TEST_F(AArch64GISelMITest, LowerBitCountingCTTZ3) {}

// CTLZ expansion in terms of CTLZ_ZERO_UNDEF
TEST_F(AArch64GISelMITest, LowerBitCountingCTLZ0) {}

// CTLZ expansion in terms of CTLZ_ZERO_UNDEF if the latter is a libcall
TEST_F(AArch64GISelMITest, LowerBitCountingCTLZLibcall) {}

// CTLZ expansion
TEST_F(AArch64GISelMITest, LowerBitCountingCTLZ1) {}

// CTLZ widening.
TEST_F(AArch64GISelMITest, WidenBitCountingCTLZ) {}

// CTLZ_ZERO_UNDEF widening.
TEST_F(AArch64GISelMITest, WidenBitCountingCTLZZeroUndef) {}

// CTPOP widening.
TEST_F(AArch64GISelMITest, WidenBitCountingCTPOP) {}

// CTTZ_ZERO_UNDEF widening.
TEST_F(AArch64GISelMITest, WidenBitCountingCTTZ_ZERO_UNDEF) {}

// CTTZ widening.
TEST_F(AArch64GISelMITest, WidenBitCountingCTTZ) {}
// UADDO widening.
TEST_F(AArch64GISelMITest, WidenUADDO) {}

// USUBO widening.
TEST_F(AArch64GISelMITest, WidenUSUBO) {}

// SADDO widening.
TEST_F(AArch64GISelMITest, WidenSADDO) {}

// SSUBO widening.
TEST_F(AArch64GISelMITest, WidenSSUBO) {}

TEST_F(AArch64GISelMITest, WidenUADDE) {}

TEST_F(AArch64GISelMITest, WidenUSUBE) {}

TEST_F(AArch64GISelMITest, WidenSADDE) {}

TEST_F(AArch64GISelMITest, WidenSSUBE) {}

TEST_F(AArch64GISelMITest, WidenUMULOCondition) {}

TEST_F(AArch64GISelMITest, NarrowUADDO) {}

TEST_F(AArch64GISelMITest, NarrowUSUBO) {}

TEST_F(AArch64GISelMITest, NarrowSADDO) {}

TEST_F(AArch64GISelMITest, NarrowSSUBO) {}

TEST_F(AArch64GISelMITest, NarrowUADDE) {}

TEST_F(AArch64GISelMITest, NarrowUSUBE) {}

TEST_F(AArch64GISelMITest, NarrowSADDE) {}

TEST_F(AArch64GISelMITest, NarrowSSUBE) {}

TEST_F(AArch64GISelMITest, FewerElementsAnd) {}

TEST_F(AArch64GISelMITest, MoreElementsAnd) {}

TEST_F(AArch64GISelMITest, FewerElementsPhi) {}

// FNEG expansion in terms of XOR
TEST_F(AArch64GISelMITest, LowerFNEG) {}

TEST_F(AArch64GISelMITest, LowerMinMax) {}

TEST_F(AArch64GISelMITest, WidenScalarBuildVector) {}

TEST_F(AArch64GISelMITest, LowerMergeValues) {}

TEST_F(AArch64GISelMITest, WidenScalarMergeValuesPointer) {}

TEST_F(AArch64GISelMITest, WidenSEXTINREG) {}

TEST_F(AArch64GISelMITest, NarrowSEXTINREG) {}

TEST_F(AArch64GISelMITest, NarrowSEXTINREG2) {}

TEST_F(AArch64GISelMITest, LowerSEXTINREG) {}

TEST_F(AArch64GISelMITest, LibcallFPExt) {}

TEST_F(AArch64GISelMITest, LibcallFPTrunc) {}

TEST_F(AArch64GISelMITest, LibcallSimple) {}

TEST_F(AArch64GISelMITest, LibcallMul) {}

TEST_F(AArch64GISelMITest, LibcallSRem) {}

TEST_F(AArch64GISelMITest, LibcallURem) {}

TEST_F(AArch64GISelMITest, LibcallCtlzZeroUndef) {}

TEST_F(AArch64GISelMITest, LibcallFAdd) {}

TEST_F(AArch64GISelMITest, LibcallFSub) {}

TEST_F(AArch64GISelMITest, LibcallFMul) {}

TEST_F(AArch64GISelMITest, LibcallFDiv) {}

TEST_F(AArch64GISelMITest, LibcallFExp) {}

TEST_F(AArch64GISelMITest, LibcallFExp2) {}

TEST_F(AArch64GISelMITest, LibcallFRem) {}

TEST_F(AArch64GISelMITest, LibcallFPow) {}

TEST_F(AArch64GISelMITest, LibcallFMa) {}

TEST_F(AArch64GISelMITest, LibcallFCeil) {}

TEST_F(AArch64GISelMITest, LibcallFFloor) {}

TEST_F(AArch64GISelMITest, LibcallFMinNum) {}

TEST_F(AArch64GISelMITest, LibcallFMaxNum) {}

TEST_F(AArch64GISelMITest, LibcallFSqrt) {}

TEST_F(AArch64GISelMITest, LibcallFRint) {}

TEST_F(AArch64GISelMITest, LibcallFNearbyInt) {}

TEST_F(AArch64GISelMITest, NarrowScalarExtract) {}

TEST_F(AArch64GISelMITest, LowerInsert) {}

// Test lowering of G_FFLOOR
TEST_F(AArch64GISelMITest, LowerFFloor) {}

// Test lowering of G_BSWAP
TEST_F(AArch64GISelMITest, LowerBSWAP) {}

// Test lowering of G_SDIVREM into G_SDIV and G_SREM
TEST_F(AArch64GISelMITest, LowerSDIVREM) {}

// Test lowering of G_UDIVREM into G_UDIV and G_UREM
TEST_F(AArch64GISelMITest, LowerUDIVREM) {}

// Test G_SELECT lowering.
// Note: This is for testing the legalizer, aarch64 does not lower scalar
// selects like this.
TEST_F(AArch64GISelMITest, LowerSelect) {}

// Test widening of G_UNMERGE_VALUES
TEST_F(AArch64GISelMITest, WidenUnmerge) {}

TEST_F(AArch64GISelMITest, BitcastLoad) {}

TEST_F(AArch64GISelMITest, BitcastStore) {}

TEST_F(AArch64GISelMITest, BitcastSelect) {}

TEST_F(AArch64GISelMITest, BitcastBitOps) {}

TEST_F(AArch64GISelMITest, CreateLibcall) {}

// Test narrowing of G_IMPLICIT_DEF
TEST_F(AArch64GISelMITest, NarrowImplicitDef) {}

// Test widening of G_FREEZE
TEST_F(AArch64GISelMITest, WidenFreeze) {}

// Test narrowing of G_FREEZE
TEST_F(AArch64GISelMITest, NarrowFreeze) {}

// Test fewer elements of G_FREEZE
TEST_F(AArch64GISelMITest, FewerElementsFreeze) {}

// Test more elements of G_FREEZE
TEST_F(AArch64GISelMITest, MoreElementsFreeze) {}

// Test fewer elements of G_INSERT_VECTOR_ELEMENT
TEST_F(AArch64GISelMITest, FewerElementsInsertVectorElt) {}

// Test widen scalar of G_UNMERGE_VALUES
TEST_F(AArch64GISelMITest, widenScalarUnmerge) {}

// Test moreElements of G_SHUFFLE_VECTOR.
TEST_F(AArch64GISelMITest, moreElementsShuffle) {}

// Test narror scalar of G_SHL with constant shift amount
TEST_F(AArch64GISelMITest, narrowScalarShiftByConstant) {}

TEST_F(AArch64GISelMITest, MoreElementsSelect) {}

} // namespace