summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/CodeGen/GlobalISel/MachineIRBuilderTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [GISel][UnitTest] Fix a bunch of tests that were not doing anythingQuentin Colombet2019-10-111-0/+9
| | | | | | | | | | | After r368065, all the tests using GISelMITest must call setUp() before doing anything, otherwise the TargetMachine is not going to be set up. A few tests added after that commit were not doing that and ended up testing effectively nothing. Fix the setup of all the tests and fix the failing tests. llvm-svn: 374595
* [MachineIRBuilder] Fix an assertion failure with buildMergeQuentin Colombet2019-10-111-0/+39
| | | | | | | | | | | | | | | | Teach buildMerge how to deal with scalar to vector kind of requests. Prior to this patch, buildMerge would issue either a G_MERGE_VALUES when all the vregs are scalars or a G_CONCAT_VECTORS when the destination vreg is a vector. G_CONCAT_VECTORS was actually not the proper instruction when the source vregs were scalars and the compiler would assert that the sources must be vectors. Instead we want is to issue a G_BUILD_VECTOR when we are in this situation. This patch fixes that. llvm-svn: 374588
* GlobalISel: Add G_FMAD instructionMatt Arsenault2019-09-061-0/+4
| | | | llvm-svn: 371254
* [GISel]: Add GISelKnownBits analysisAditya Nandakumar2019-08-061-0/+2
| | | | | | | | | | | | | | https://reviews.llvm.org/D65698 This adds a KnownBits analysis pass for GISel. This was done as a pass (compared to static functions) so that we can add other features such as caching queries(within a pass and across passes) in the future. This patch only adds the basic pass boiler plate, and implements a lazy non caching knownbits implementation (ported from SelectionDAG). I've also hooked up the AArch64PreLegalizerCombiner pass to use this - there should be no compile time regression as the analysis is lazy. llvm-svn: 368065
* GlobalISel: Add G_ATOMICRMW_{FADD|FSUB}Matt Arsenault2019-07-301-0/+30
| | | | llvm-svn: 367369
* CodeGen: Introduce a class for registersMatt Arsenault2019-06-241-9/+9
| | | | | | | | | Avoids using a plain unsigned for registers throughoug codegen. Doesn't attempt to change every register use, just something a little more than the set needed to build after changing the return type of MachineOperand::getReg(). llvm-svn: 364191
* GlobalISel: Define integer min/max instructionsMatt Arsenault2019-05-171-0/+25
| | | | | | | Doesn't attempt to emit them for anything yet, but some legalizations I want to port use them. llvm-svn: 361061
* GlobalISel: Add fp<->int casts to MachineIRBuilderMatt Arsenault2019-05-171-0/+24
| | | | llvm-svn: 361019
* GlobalISel: Add MIRBuilder wrappers for bitcount instructionsMatt Arsenault2019-05-171-0/+27
| | | | | | Various expansions use these. llvm-svn: 361018
* GlobalISel: Add buildFMA to MachineIRBuilderMatt Arsenault2019-05-161-0/+3
| | | | llvm-svn: 360888
* GlobalISel: Add buildXor/buildNotMatt Arsenault2019-05-161-0/+28
| | | | llvm-svn: 360880
* GlobalISel: Add DstOp version of buildIntrinsicMatt Arsenault2019-05-161-0/+28
| | | | llvm-svn: 360879
* GlobalISel: Add buildFConstant for APFloatMatt Arsenault2019-05-161-0/+5
| | | | llvm-svn: 360853
* GlobalISel: Add some FP instructions to MachineIRBuilderMatt Arsenault2019-05-161-0/+28
| | | | | | This makes FP legalization code more convenient. llvm-svn: 360852
* GlobalISel: Add another overload of buildUnmergeMatt Arsenault2019-04-051-0/+20
| | | | | | | It's annoying to have to create an array of the result type, particularly when you don't care about the size of the value. llvm-svn: 357763
* GlobalISel: Allow constructing SrcOp/DstOp from MachineOperandMatt Arsenault2019-02-041-0/+25
| | | | llvm-svn: 353080
* GlobalISel: Fix CSE handling of buildConstantMatt Arsenault2019-02-041-4/+36
| | | | | | | | | | | | | | | | This fixes two problems with CSE done in buildConstant. First, this would hit an assert when used with a vector result type. Solve this by allowing CSE on the vector elements, but not on the result vector for now. Second, this was also performing the CSE based on the input ConstantInt pointer. The underlying buildConstant could potentially convert the constant depending on the result type, giving in a different ConstantInt*. Stop allowing the APInt and ConstantInt forms from automatically casting to the result type to avoid any similar problems in the future. llvm-svn: 353077
* GlobalISel: Improve gtest usageMatt Arsenault2019-02-041-2/+1
| | | | | | | Don't unnecessarily use ASSERT_*, and print the MachineFunction on failure. llvm-svn: 353072
* GlobalISel: Make buildConstant handle vectorsMatt Arsenault2019-01-221-0/+36
Produce a splat build_vector similar to how SelectionDAG::getConstant does. llvm-svn: 351880
OpenPOWER on IntegriCloud