Tim Northover
8d2f52e035
GlobalISel: support zero-sized allocas
...
All allocas must be at least 1 byte at the MachineIR level so we allocate just
one byte.
llvm-svn: 276897
2016-07-27 17:47:54 +00:00
Tim Northover
ad2b717f2c
GlobalISel: add generic load and store instructions.
...
Pretty straightforward, the only oddity is the MachineMemOperand (which it's
surprisingly difficult to share code for).
llvm-svn: 276799
2016-07-26 20:23:26 +00:00
Tim Northover
756eca35cf
GlobalISel: add specialized buildCopy function to MachineInstrBuilder.
...
NFC.
llvm-svn: 276763
2016-07-26 16:45:30 +00:00
Tim Northover
cc5f76226b
GlobalISel: give MachineInstrBuilder a uniform interface. NFC.
...
Instead of an ad-hoc collection of "buildInstr" functions with varying numbers
of registers, this uses variadic templates to provide for as many regs as
needed!
Also make IRtranslator use new "buildBr" function instead of some weird generic
one that no-one else would really use.
llvm-svn: 276762
2016-07-26 16:45:26 +00:00
Tim Northover
884b47ecfd
GlobalISel: remove redundant ';'s. NFC
...
llvm-svn: 276723
2016-07-26 03:29:18 +00:00
Tim Northover
7c9eba90ff
GlobalISel: add generic casts to IRTranslator
...
This adds LLVM's 3 main cast instructions (inttoptr, ptrtoint, bitcast) to the
IRTranslator. The first two are direct translations (with 2 MachineInstr types
each). Since LLT discards information, a bitcast might become trivial and we
emit a COPY in those cases instead.
llvm-svn: 276690
2016-07-25 21:01:29 +00:00
Tim Northover
bd5054602e
GlobalISel: implement alloca instruction
...
llvm-svn: 276433
2016-07-22 16:59:52 +00:00
Quentin Colombet
2b59eab79f
[IRTranslator] Add G_SUB opcode.
...
This commit adds a generic SUB opcode to global-isel.
llvm-svn: 276308
2016-07-21 17:26:50 +00:00
Quentin Colombet
19df8a1aba
[IRTranslator] Add comments to explain the ordering of the switch. NFC.
...
Group arithmetic operations, bitwise operations, and branch operations.
llvm-svn: 276305
2016-07-21 17:26:41 +00:00
Quentin Colombet
7bcc921dd8
[IRTranslator] Add G_AND opcode.
...
This commit adds a generic AND opcode to global-isel.
llvm-svn: 276297
2016-07-21 15:50:42 +00:00
Tim Northover
62ae568bbb
GlobalISel: implement low-level type with just size & vector lanes.
...
This should be all the low-level instruction selection needs to determine how
to implement an operation, with the remaining context taken from the opcode
(e.g. G_ADD vs G_FADD) or other flags not based on type (e.g. fast-math).
llvm-svn: 276158
2016-07-20 19:09:30 +00:00
Tim Northover
72eebfa4b0
GlobalISel: freeze reserved regs after IRTranslator.
...
We can freeze the registers after the MachineFrameInfo has been configured (by
telling it about calls, inline asm, ...). This doesn't happen at all yet, but
will be part of IR translation.
Fixes -verify-machineinstrs assertion.
llvm-svn: 275221
2016-07-12 22:23:42 +00:00
Quentin Colombet
f2a1909bb5
[IRTranslator] Support the translation of or.
...
Now or instructions get translated into G_OR.
llvm-svn: 272433
2016-06-10 20:50:35 +00:00
Quentin Colombet
13c55e07ed
[IRTranslator] Refactor to expose a translateBinaryOp method.
...
This method will be used for every binary operation.
NFC.
llvm-svn: 272431
2016-06-10 20:50:18 +00:00
Tom Stellard
b72a65ff53
[GlobalISel] Coding style and whitespace fixes
...
Reviewers: qcolombet
Subscribers: joker.eph, llvm-commits, vkalintiris
Differential Revision: http://reviews.llvm.org/D19119
llvm-svn: 266342
2016-04-14 17:23:33 +00:00
Quentin Colombet
dd4b137364
[IRTranslator] Translate unconditional branches.
...
llvm-svn: 263265
2016-03-11 17:28:03 +00:00
Quentin Colombet
e225e2541b
[IRTranslator] Update getOrCreateVReg API to use references.
...
A value that we want to keep in a virtual register cannot be null.
Reflect that in the API.
llvm-svn: 263263
2016-03-11 17:27:54 +00:00
Quentin Colombet
000b580b13
[MachineIRBuilder] Rename the setter of MF for consistency with the getter.
...
llvm-svn: 263262
2016-03-11 17:27:51 +00:00
Quentin Colombet
91ebd71e26
[MachineIRBuilder] Rename the setter for MBB for consistency with the getter.
...
llvm-svn: 263261
2016-03-11 17:27:47 +00:00
Quentin Colombet
53237a9e64
[IRTranslator] Update getOrCreateBB API to use references.
...
A null basic block is invalid, so just pass a reference.
llvm-svn: 263260
2016-03-11 17:27:43 +00:00
Quentin Colombet
39293d3aaa
[GlobalISel] Introduce initializer method to support start/stop-after features.
...
llvm-svn: 262896
2016-03-08 01:38:55 +00:00
Quentin Colombet
ba2a01645b
[GlobalISel] Re-apply r260922-260923 with MSVC-friendly code.
...
Original message:
Get rid of the ifdefs in TargetLowering.
Introduce a new API used only by GlobalISel: CallLowering.
This API will contain target hooks dedicated to call lowering.
llvm-svn: 260998
2016-02-16 19:26:02 +00:00
Aaron Ballman
fc64ef1a15
Reverting r260922-260923; they cause link failures with MSVC.
...
http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc2015/builds/15436/steps/build/logs/stdio
http://bb.pgr.jp/builders/msbuild-llvmclang-x64-msc18-DA/builds/961/steps/build_llvm/logs/stdio
llvm-svn: 260972
2016-02-16 15:29:06 +00:00
Quentin Colombet
1ce38545fb
[GlobalISel] Get rid of the ifdefs in TargetLowering.
...
Introduce a new API used only by GlobalISel: CallLowering.
This API will contain target hooks dedicated to call lowering.
llvm-svn: 260922
2016-02-16 00:57:44 +00:00
Quentin Colombet
ccd7725808
[IRTranslator] Use a single virtual register to represent any Value.
...
PR26161.
llvm-svn: 260602
2016-02-11 21:48:32 +00:00
Quentin Colombet
fd9d0a07d8
[GlobalISel] Add the necessary plumbing to lower formal arguments.
...
llvm-svn: 260579
2016-02-11 19:59:41 +00:00
Quentin Colombet
74d7d2f00b
[GlobalISel] Teach the IRTranslator how to lower returns.
...
llvm-svn: 260562
2016-02-11 18:53:28 +00:00
Quentin Colombet
a7fae162e6
[GlobalISel][IRTranslator] Change the ownership of the MIRBuilder field.
...
llvm-svn: 260551
2016-02-11 17:53:23 +00:00
Quentin Colombet
4f0ec8d2b0
[GlobalISel][IRTranslator] Fix a typo in assert.
...
llvm-svn: 260550
2016-02-11 17:52:28 +00:00
Quentin Colombet
17c494b91c
[GlobalISel][IRTranslator] Teach the pass how to translate Add instructions.
...
llvm-svn: 260549
2016-02-11 17:51:31 +00:00
Quentin Colombet
2ecff3bff2
[GlobalISel] More detailed skeleton for the IRTranslator.
...
llvm-svn: 260456
2016-02-10 22:59:27 +00:00
Quentin Colombet
105cf2b179
[GlobalISel] Add the proper cmake plumbing.
...
This patch adds the necessary plumbing to cmake to build the sources related to
GlobalISel.
To build the sources related to GlobalISel, we need to add -DBUILD_GLOBAL_ISEL=ON.
By default, this is OFF, thus GlobalISel sources will not impact people that do
not explicitly opt-in.
Differential Revision: http://reviews.llvm.org/D15983
llvm-svn: 258344
2016-01-20 20:58:56 +00:00