namespace {
-TEST_F(GISelMITest, TestCSE) {
+TEST_F(AArch64GISelMITest, TestCSE) {
setUp();
if (!TM)
return;
EXPECT_EQ(&*Undef0, &*Undef1);
}
-TEST_F(GISelMITest, TestCSEConstantConfig) {
+TEST_F(AArch64GISelMITest, TestCSEConstantConfig) {
setUp();
if (!TM)
return;
namespace {
-TEST_F(GISelMITest, FoldWithBuilder) {
+TEST_F(AArch64GISelMITest, FoldWithBuilder) {
setUp();
if (!TM)
return;
EXPECT_EQ(-0x80, Cst);
}
-TEST_F(GISelMITest, FoldBinOp) {
+TEST_F(AArch64GISelMITest, FoldBinOp) {
setUp();
if (!TM)
return;
}
}
+
+std::unique_ptr<LLVMTargetMachine>
+AArch64GISelMITest::createTargetMachine() const {
+ Triple TargetTriple("aarch64--");
+ std::string Error;
+ const Target *T = TargetRegistry::lookupTarget("", TargetTriple, Error);
+ if (!T)
+ return nullptr;
+
+ TargetOptions Options;
+ return std::unique_ptr<LLVMTargetMachine>(
+ static_cast<LLVMTargetMachine *>(T->createTargetMachine(
+ "AArch64", "", "", Options, None, None, CodeGenOpt::Aggressive)));
+}
+
+void AArch64GISelMITest::getTargetTestModuleString(SmallString<512> &S,
+ StringRef MIRFunc) const {
+ (Twine(R"MIR(
+---
+...
+name: func
+tracksRegLiveness: true
+registers:
+ - { id: 0, class: _ }
+ - { id: 1, class: _ }
+ - { id: 2, class: _ }
+ - { id: 3, class: _ }
+body: |
+ bb.1:
+ liveins: $x0, $x1, $x2, $x4
+
+ %0(s64) = COPY $x0
+ %1(s64) = COPY $x1
+ %2(s64) = COPY $x2
+)MIR") +
+ Twine(MIRFunc) + Twine("...\n"))
+ .toNullTerminatedStringRef(S);
+}
operator<<(std::ostream &OS, const MachineFunction &MF);
}
-/// Create a TargetMachine. As we lack a dedicated always available target for
-/// unittests, we go for "AArch64".
-static std::unique_ptr<LLVMTargetMachine> createTargetMachine() {
- Triple TargetTriple("aarch64--");
- std::string Error;
- const Target *T = TargetRegistry::lookupTarget("", TargetTriple, Error);
- if (!T)
- return nullptr;
-
- TargetOptions Options;
- return std::unique_ptr<LLVMTargetMachine>(
- static_cast<LLVMTargetMachine *>(T->createTargetMachine(
- "AArch64", "", "", Options, None, None, CodeGenOpt::Aggressive)));
-}
-
static std::unique_ptr<Module> parseMIR(LLVMContext &Context,
std::unique_ptr<MIRParser> &MIR,
const TargetMachine &TM,
return M;
}
-
static std::pair<std::unique_ptr<Module>, std::unique_ptr<MachineModuleInfo>>
createDummyModule(LLVMContext &Context, const LLVMTargetMachine &TM,
- StringRef MIRFunc) {
- SmallString<512> S;
- StringRef MIRString = (Twine(R"MIR(
----
-...
-name: func
-tracksRegLiveness: true
-registers:
- - { id: 0, class: _ }
- - { id: 1, class: _ }
- - { id: 2, class: _ }
- - { id: 3, class: _ }
-body: |
- bb.1:
- liveins: $x0, $x1, $x2, $x4
-
- %0(s64) = COPY $x0
- %1(s64) = COPY $x1
- %2(s64) = COPY $x2
-)MIR") + Twine(MIRFunc) + Twine("...\n"))
- .toNullTerminatedStringRef(S);
+ StringRef MIRString, const char *FuncName) {
std::unique_ptr<MIRParser> MIR;
auto MMI = std::make_unique<MachineModuleInfo>(&TM);
std::unique_ptr<Module> M =
- parseMIR(Context, MIR, TM, MIRString, "func", *MMI);
+ parseMIR(Context, MIR, TM, MIRString, FuncName, *MMI);
return make_pair(std::move(M), std::move(MMI));
}
class GISelMITest : public ::testing::Test {
protected:
GISelMITest() : ::testing::Test() {}
+
+ /// Prepare a target specific LLVMTargetMachine.
+ virtual std::unique_ptr<LLVMTargetMachine> createTargetMachine() const = 0;
+
+ /// Get the stub sample MIR test function.
+ virtual void getTargetTestModuleString(SmallString<512> &S,
+ StringRef MIRFunc) const = 0;
+
void setUp(StringRef ExtraAssembly = "") {
TM = createTargetMachine();
if (!TM)
return;
- ModuleMMIPair = createDummyModule(Context, *TM, ExtraAssembly);
+
+ SmallString<512> MIRString;
+ getTargetTestModuleString(MIRString, ExtraAssembly);
+
+ ModuleMMIPair = createDummyModule(Context, *TM, MIRString, "func");
MF = getMFFromMMI(ModuleMMIPair.first.get(), ModuleMMIPair.second.get());
collectCopies(Copies, MF);
EntryMBB = &*MF->begin();
MRI = &MF->getRegInfo();
B.setInsertPt(*EntryMBB, EntryMBB->end());
}
+
LLVMContext Context;
std::unique_ptr<LLVMTargetMachine> TM;
MachineFunction *MF;
MachineRegisterInfo *MRI;
};
+class AArch64GISelMITest : public GISelMITest {
+ std::unique_ptr<LLVMTargetMachine> createTargetMachine() const override;
+ void getTargetTestModuleString(SmallString<512> &S,
+ StringRef MIRFunc) const override;
+};
+
#define DefineLegalizerInfo(Name, SettingUpActionsBlock) \
class Name##Info : public LegalizerInfo { \
public: \
#include "llvm/CodeGen/GlobalISel/GISelKnownBits.h"
#include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
-TEST_F(GISelMITest, TestKnownBitsCst) {
+TEST_F(AArch64GISelMITest, TestKnownBitsCst) {
StringRef MIRString = " %3:_(s8) = G_CONSTANT i8 1\n"
" %4:_(s8) = COPY %3\n";
setUp(MIRString);
EXPECT_EQ(Res.Zero.getZExtValue(), Res2.Zero.getZExtValue());
}
-TEST_F(GISelMITest, TestKnownBitsCstWithClass) {
+TEST_F(AArch64GISelMITest, TestKnownBitsCstWithClass) {
StringRef MIRString = " %10:gpr32 = MOVi32imm 1\n"
" %4:_(s32) = COPY %10\n";
setUp(MIRString);
// Check that we are able to track bits through PHIs
// and get the intersections of everything we know on each operand.
-TEST_F(GISelMITest, TestKnownBitsCstPHI) {
+TEST_F(AArch64GISelMITest, TestKnownBitsCstPHI) {
StringRef MIRString = " bb.10:\n"
" %10:_(s8) = G_CONSTANT i8 3\n"
" %11:_(s1) = G_IMPLICIT_DEF\n"
// Check that we report we know nothing when we hit a
// non-generic register.
// Note: this could be improved though!
-TEST_F(GISelMITest, TestKnownBitsCstPHIToNonGenericReg) {
+TEST_F(AArch64GISelMITest, TestKnownBitsCstPHIToNonGenericReg) {
StringRef MIRString = " bb.10:\n"
" %10:gpr32 = MOVi32imm 3\n"
" %11:_(s1) = G_IMPLICIT_DEF\n"
// here to cover the code that stops the analysis of PHIs
// earlier. In that case, we would not even look at the
// second incoming value.
-TEST_F(GISelMITest, TestKnownBitsUnknownPHI) {
+TEST_F(AArch64GISelMITest, TestKnownBitsUnknownPHI) {
StringRef MIRString =
" bb.10:\n"
" %10:_(s64) = COPY %0\n"
// For now, the analysis just stops and assumes it knows nothing,
// eventually we could teach it how to properly track phis that
// loop back.
-TEST_F(GISelMITest, TestKnownBitsCstPHIWithLoop) {
+TEST_F(AArch64GISelMITest, TestKnownBitsCstPHIWithLoop) {
StringRef MIRString =
" bb.10:\n"
" %10:_(s8) = G_CONSTANT i8 3\n"
// on PHIs, but eventually we could teach it how to properly track
// phis that loop back without relying on the luck effect of max
// depth.
-TEST_F(GISelMITest, TestKnownBitsDecreasingCstPHIWithLoop) {
+TEST_F(AArch64GISelMITest, TestKnownBitsDecreasingCstPHIWithLoop) {
StringRef MIRString = " bb.10:\n"
" %10:_(s8) = G_CONSTANT i8 5\n"
" %11:_(s8) = G_CONSTANT i8 1\n"
EXPECT_EQ(Res.Zero.getZExtValue(), Res2.Zero.getZExtValue());
}
-TEST_F(GISelMITest, TestKnownBitsPtrToIntViceVersa) {
+TEST_F(AArch64GISelMITest, TestKnownBitsPtrToIntViceVersa) {
StringRef MIRString = " %3:_(s16) = G_CONSTANT i16 256\n"
" %4:_(p0) = G_INTTOPTR %3\n"
" %5:_(s32) = G_PTRTOINT %4\n"
EXPECT_EQ(256u, Res.One.getZExtValue());
EXPECT_EQ(0xfffffeffu, Res.Zero.getZExtValue());
}
-TEST_F(GISelMITest, TestKnownBitsXOR) {
+TEST_F(AArch64GISelMITest, TestKnownBitsXOR) {
StringRef MIRString = " %3:_(s8) = G_CONSTANT i8 4\n"
" %4:_(s8) = G_CONSTANT i8 7\n"
" %5:_(s8) = G_XOR %3, %4\n"
EXPECT_EQ(252u, Res.Zero.getZExtValue());
}
-TEST_F(GISelMITest, TestKnownBits) {
+TEST_F(AArch64GISelMITest, TestKnownBits) {
StringRef MIR = " %3:_(s32) = G_TRUNC %0\n"
" %4:_(s32) = G_TRUNC %1\n"
EXPECT_EQ(Known.Zero, Zeroes);
}
-TEST_F(GISelMITest, TestSignBitIsZero) {
+TEST_F(AArch64GISelMITest, TestSignBitIsZero) {
setUp();
if (!TM)
return;
EXPECT_FALSE(KnownBits.signBitIsZero(SignBit.getReg(0)));
}
-TEST_F(GISelMITest, TestNumSignBitsConstant) {
+TEST_F(AArch64GISelMITest, TestNumSignBitsConstant) {
StringRef MIRString = " %3:_(s8) = G_CONSTANT i8 1\n"
" %4:_(s8) = COPY %3\n"
EXPECT_EQ(3u, Info.computeNumSignBits(CopyRegNeg32));
}
-TEST_F(GISelMITest, TestNumSignBitsSext) {
+TEST_F(AArch64GISelMITest, TestNumSignBitsSext) {
StringRef MIRString = " %3:_(p0) = G_IMPLICIT_DEF\n"
" %4:_(s8) = G_LOAD %3 :: (load 1)\n"
" %5:_(s32) = G_SEXT %4\n"
EXPECT_EQ(32u, Info.computeNumSignBits(CopySextNeg1));
}
-TEST_F(GISelMITest, TestNumSignBitsTrunc) {
+TEST_F(AArch64GISelMITest, TestNumSignBitsTrunc) {
StringRef MIRString = " %3:_(p0) = G_IMPLICIT_DEF\n"
" %4:_(s32) = G_LOAD %3 :: (load 4)\n"
" %5:_(s8) = G_TRUNC %4\n"
// Test CTTZ expansion when CTTZ_ZERO_UNDEF is legal or custom,
// in which case it becomes CTTZ_ZERO_UNDEF with select.
-TEST_F(GISelMITest, LowerBitCountingCTTZ0) {
+TEST_F(AArch64GISelMITest, LowerBitCountingCTTZ0) {
setUp();
if (!TM)
return;
}
// CTTZ expansion in terms of CTLZ
-TEST_F(GISelMITest, LowerBitCountingCTTZ1) {
+TEST_F(AArch64GISelMITest, LowerBitCountingCTTZ1) {
setUp();
if (!TM)
return;
}
// CTLZ scalar narrowing
-TEST_F(GISelMITest, NarrowScalarCTLZ) {
+TEST_F(AArch64GISelMITest, NarrowScalarCTLZ) {
setUp();
if (!TM)
return;
}
// CTTZ scalar narrowing
-TEST_F(GISelMITest, NarrowScalarCTTZ) {
+TEST_F(AArch64GISelMITest, NarrowScalarCTTZ) {
setUp();
if (!TM)
return;
}
// CTTZ expansion in terms of CTPOP
-TEST_F(GISelMITest, LowerBitCountingCTTZ2) {
+TEST_F(AArch64GISelMITest, LowerBitCountingCTTZ2) {
setUp();
if (!TM)
return;
}
// CTPOP widening.
-TEST_F(GISelMITest, WidenBitCountingCTPOP1) {
+TEST_F(AArch64GISelMITest, WidenBitCountingCTPOP1) {
if (!TM)
return;
}
// Test a strange case where the result is wider than the source
-TEST_F(GISelMITest, WidenBitCountingCTPOP2) {
+TEST_F(AArch64GISelMITest, WidenBitCountingCTPOP2) {
if (!TM)
return;
}
// CTTZ_ZERO_UNDEF expansion in terms of CTTZ
-TEST_F(GISelMITest, LowerBitCountingCTTZ3) {
+TEST_F(AArch64GISelMITest, LowerBitCountingCTTZ3) {
setUp();
if (!TM)
return;
}
// CTLZ expansion in terms of CTLZ_ZERO_UNDEF
-TEST_F(GISelMITest, LowerBitCountingCTLZ0) {
+TEST_F(AArch64GISelMITest, LowerBitCountingCTLZ0) {
setUp();
if (!TM)
return;
}
// CTLZ expansion in terms of CTLZ_ZERO_UNDEF if the latter is a libcall
-TEST_F(GISelMITest, LowerBitCountingCTLZLibcall) {
+TEST_F(AArch64GISelMITest, LowerBitCountingCTLZLibcall) {
setUp();
if (!TM)
return;
}
// CTLZ expansion
-TEST_F(GISelMITest, LowerBitCountingCTLZ1) {
+TEST_F(AArch64GISelMITest, LowerBitCountingCTLZ1) {
setUp();
if (!TM)
return;
}
// CTLZ widening.
-TEST_F(GISelMITest, WidenBitCountingCTLZ) {
+TEST_F(AArch64GISelMITest, WidenBitCountingCTLZ) {
setUp();
if (!TM)
return;
}
// CTLZ_ZERO_UNDEF widening.
-TEST_F(GISelMITest, WidenBitCountingCTLZZeroUndef) {
+TEST_F(AArch64GISelMITest, WidenBitCountingCTLZZeroUndef) {
setUp();
if (!TM)
return;
}
// CTPOP widening.
-TEST_F(GISelMITest, WidenBitCountingCTPOP) {
+TEST_F(AArch64GISelMITest, WidenBitCountingCTPOP) {
setUp();
if (!TM)
return;
}
// CTTZ_ZERO_UNDEF widening.
-TEST_F(GISelMITest, WidenBitCountingCTTZ_ZERO_UNDEF) {
+TEST_F(AArch64GISelMITest, WidenBitCountingCTTZ_ZERO_UNDEF) {
setUp();
if (!TM)
return;
}
// CTTZ widening.
-TEST_F(GISelMITest, WidenBitCountingCTTZ) {
+TEST_F(AArch64GISelMITest, WidenBitCountingCTTZ) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
// UADDO widening.
-TEST_F(GISelMITest, WidenUADDO) {
+TEST_F(AArch64GISelMITest, WidenUADDO) {
setUp();
if (!TM)
return;
}
// USUBO widening.
-TEST_F(GISelMITest, WidenUSUBO) {
+TEST_F(AArch64GISelMITest, WidenUSUBO) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, FewerElementsAnd) {
+TEST_F(AArch64GISelMITest, FewerElementsAnd) {
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, MoreElementsAnd) {
+TEST_F(AArch64GISelMITest, MoreElementsAnd) {
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, FewerElementsPhi) {
+TEST_F(AArch64GISelMITest, FewerElementsPhi) {
if (!TM)
return;
}
// FNEG expansion in terms of FSUB
-TEST_F(GISelMITest, LowerFNEG) {
+TEST_F(AArch64GISelMITest, LowerFNEG) {
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LowerMinMax) {
+TEST_F(AArch64GISelMITest, LowerMinMax) {
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, WidenScalarBuildVector) {
+TEST_F(AArch64GISelMITest, WidenScalarBuildVector) {
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LowerMergeValues) {
+TEST_F(AArch64GISelMITest, LowerMergeValues) {
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, WidenScalarMergeValuesPointer) {
+TEST_F(AArch64GISelMITest, WidenScalarMergeValuesPointer) {
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, WidenSEXTINREG) {
+TEST_F(AArch64GISelMITest, WidenSEXTINREG) {
if (!TM)
return;
ASSERT_TRUE(CheckMachineFunction(*MF, CheckStr));
}
-TEST_F(GISelMITest, NarrowSEXTINREG) {
+TEST_F(AArch64GISelMITest, NarrowSEXTINREG) {
if (!TM)
return;
ASSERT_TRUE(CheckMachineFunction(*MF, CheckStr));
}
-TEST_F(GISelMITest, NarrowSEXTINREG2) {
+TEST_F(AArch64GISelMITest, NarrowSEXTINREG2) {
if (!TM)
return;
ASSERT_TRUE(CheckMachineFunction(*MF, CheckStr));
}
-TEST_F(GISelMITest, LowerSEXTINREG) {
+TEST_F(AArch64GISelMITest, LowerSEXTINREG) {
if (!TM)
return;
ASSERT_TRUE(CheckMachineFunction(*MF, CheckStr));
}
-TEST_F(GISelMITest, LibcallFPExt) {
+TEST_F(AArch64GISelMITest, LibcallFPExt) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LibcallFPTrunc) {
+TEST_F(AArch64GISelMITest, LibcallFPTrunc) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LibcallSimple) {
+TEST_F(AArch64GISelMITest, LibcallSimple) {
setUp();
if (!TM)
return;
Helper.libcall(*MIBFADD));
}
-TEST_F(GISelMITest, LibcallSRem) {
+TEST_F(AArch64GISelMITest, LibcallSRem) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LibcallURem) {
+TEST_F(AArch64GISelMITest, LibcallURem) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LibcallCtlzZeroUndef) {
+TEST_F(AArch64GISelMITest, LibcallCtlzZeroUndef) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LibcallFAdd) {
+TEST_F(AArch64GISelMITest, LibcallFAdd) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LibcallFSub) {
+TEST_F(AArch64GISelMITest, LibcallFSub) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LibcallFMul) {
+TEST_F(AArch64GISelMITest, LibcallFMul) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LibcallFDiv) {
+TEST_F(AArch64GISelMITest, LibcallFDiv) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LibcallFExp) {
+TEST_F(AArch64GISelMITest, LibcallFExp) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LibcallFExp2) {
+TEST_F(AArch64GISelMITest, LibcallFExp2) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LibcallFRem) {
+TEST_F(AArch64GISelMITest, LibcallFRem) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LibcallFPow) {
+TEST_F(AArch64GISelMITest, LibcallFPow) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LibcallFMa) {
+TEST_F(AArch64GISelMITest, LibcallFMa) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LibcallFCeil) {
+TEST_F(AArch64GISelMITest, LibcallFCeil) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LibcallFFloor) {
+TEST_F(AArch64GISelMITest, LibcallFFloor) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LibcallFMinNum) {
+TEST_F(AArch64GISelMITest, LibcallFMinNum) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LibcallFMaxNum) {
+TEST_F(AArch64GISelMITest, LibcallFMaxNum) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LibcallFSqrt) {
+TEST_F(AArch64GISelMITest, LibcallFSqrt) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LibcallFRint) {
+TEST_F(AArch64GISelMITest, LibcallFRint) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LibcallFNearbyInt) {
+TEST_F(AArch64GISelMITest, LibcallFNearbyInt) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, NarrowScalarExtract) {
+TEST_F(AArch64GISelMITest, NarrowScalarExtract) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, LowerInsert) {
+TEST_F(AArch64GISelMITest, LowerInsert) {
setUp();
if (!TM)
return;
}
// Test lowering of G_FFLOOR
-TEST_F(GISelMITest, LowerFFloor) {
+TEST_F(AArch64GISelMITest, LowerFFloor) {
setUp();
if (!TM)
return;
}
// Test lowering of G_BSWAP
-TEST_F(GISelMITest, LowerBSWAP) {
+TEST_F(AArch64GISelMITest, LowerBSWAP) {
setUp();
if (!TM)
return;
}
// Test widening of G_UNMERGE_VALUES
-TEST_F(GISelMITest, WidenUnmerge) {
+TEST_F(AArch64GISelMITest, WidenUnmerge) {
setUp();
if (!TM)
return;
getActionDefinitionsBuilder(G_SHL).legalFor({{s32, s32}});
})
-TEST_F(GISelMITest, BasicLegalizerTest) {
+TEST_F(AArch64GISelMITest, BasicLegalizerTest) {
StringRef MIRString = R"(
%vptr:_(p0) = COPY $x4
%v:_(<2 x s8>) = G_LOAD %vptr:_(p0) :: (load 2, align 1)
// Making sure the legalization finishes successfully w/o failure to combine
// away all the legalization artifacts regardless of the order of their
// creation.
-TEST_F(GISelMITest, UnorderedArtifactCombiningTest) {
+TEST_F(AArch64GISelMITest, UnorderedArtifactCombiningTest) {
StringRef MIRString = R"(
%vptr:_(p0) = COPY $x4
%v:_(<2 x s8>) = G_LOAD %vptr:_(p0) :: (load 2, align 1)
EXPECT_TRUE(CheckMachineFunction(*MF, CheckString)) << *MF;
}
-TEST_F(GISelMITest, UnorderedArtifactCombiningManyCopiesTest) {
+TEST_F(AArch64GISelMITest, UnorderedArtifactCombiningManyCopiesTest) {
StringRef MIRString = R"(
%vptr:_(p0) = COPY $x4
%v:_(<2 x s8>) = G_LOAD %vptr:_(p0) :: (load 2, align 1)
#include "GISelMITest.h"
#include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
-TEST_F(GISelMITest, TestBuildConstantFConstant) {
+TEST_F(AArch64GISelMITest, TestBuildConstantFConstant) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-
#ifdef GTEST_HAS_DEATH_TEST
#ifndef NDEBUG
-TEST_F(GISelMITest, TestBuildConstantFConstantDeath) {
+TEST_F(AArch64GISelMITest, TestBuildConstantFConstantDeath) {
setUp();
if (!TM)
return;
#endif
#endif
-TEST_F(GISelMITest, DstOpSrcOp) {
+TEST_F(AArch64GISelMITest, DstOpSrcOp) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, BuildUnmerge) {
+TEST_F(AArch64GISelMITest, BuildUnmerge) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, TestBuildFPInsts) {
+TEST_F(AArch64GISelMITest, TestBuildFPInsts) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, BuildIntrinsic) {
+TEST_F(AArch64GISelMITest, BuildIntrinsic) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, BuildXor) {
+TEST_F(AArch64GISelMITest, BuildXor) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, BuildBitCounts) {
+TEST_F(AArch64GISelMITest, BuildBitCounts) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, BuildCasts) {
+TEST_F(AArch64GISelMITest, BuildCasts) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, BuildMinMax) {
+TEST_F(AArch64GISelMITest, BuildMinMax) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, BuildAtomicRMW) {
+TEST_F(AArch64GISelMITest, BuildAtomicRMW) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, BuildMerge) {
+TEST_F(AArch64GISelMITest, BuildMerge) {
setUp();
if (!TM)
return;
EXPECT_TRUE(CheckMachineFunction(*MF, CheckStr)) << *MF;
}
-TEST_F(GISelMITest, BuildAddoSubo) {
+TEST_F(AArch64GISelMITest, BuildAddoSubo) {
setUp();
if (!TM)
return;
namespace {
-TEST_F(GISelMITest, MatchIntConstant) {
+TEST_F(AArch64GISelMITest, MatchIntConstant) {
setUp();
if (!TM)
return;
EXPECT_EQ(Cst, 42);
}
-TEST_F(GISelMITest, MatchBinaryOp) {
+TEST_F(AArch64GISelMITest, MatchBinaryOp) {
setUp();
if (!TM)
return;
EXPECT_EQ(Src1, TruncCopy1.getReg(0));
}
-TEST_F(GISelMITest, MatchICmp) {
+TEST_F(AArch64GISelMITest, MatchICmp) {
setUp();
if (!TM)
return;
EXPECT_EQ(Copies[1], Reg1);
}
-TEST_F(GISelMITest, MatchFCmp) {
+TEST_F(AArch64GISelMITest, MatchFCmp) {
setUp();
if (!TM)
return;
EXPECT_EQ(Copies[1], Reg1);
}
-TEST_F(GISelMITest, MatchFPUnaryOp) {
+TEST_F(AArch64GISelMITest, MatchFPUnaryOp) {
setUp();
if (!TM)
return;
EXPECT_NE(TmpFP16, TmpFP);
}
-TEST_F(GISelMITest, MatchExtendsTrunc) {
+TEST_F(AArch64GISelMITest, MatchExtendsTrunc) {
setUp();
if (!TM)
return;
EXPECT_EQ(Src0, Copies[0]);
}
-TEST_F(GISelMITest, MatchSpecificType) {
+TEST_F(AArch64GISelMITest, MatchSpecificType) {
setUp();
if (!TM)
return;
EXPECT_EQ(Src0, Copies[0]);
}
-TEST_F(GISelMITest, MatchCombinators) {
+TEST_F(AArch64GISelMITest, MatchCombinators) {
setUp();
if (!TM)
return;
EXPECT_FALSE(match);
}
-TEST_F(GISelMITest, MatchMiscellaneous) {
+TEST_F(AArch64GISelMITest, MatchMiscellaneous) {
setUp();
if (!TM)
return;