240 Commits

Author SHA1 Message Date
Matt Arsenault
2097552a47 GlobalISel: Implement lower for G_SADDO/G_SSUBO
Port directly from SelectionDAG, minus the path using
ISD::SADDSAT/ISD::SSUBSAT.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375042 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-16 20:46:32 +00:00
Matt Arsenault
64f5ca7e80 GlobalISel: Implement fewerElementsVector for G_BUILD_VECTOR
Turn it into a G_CONCAT_VECTORS of G_BUILD_VECTOR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374252 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-09 22:44:43 +00:00
Matt Arsenault
0401164ba7 GlobalISel: Partially implement lower for G_INSERT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373946 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-07 19:13:27 +00:00
Matt Arsenault
97454bf24b GlobalISel: Partially implement lower for G_EXTRACT
Turn into shift and truncate. Doesn't yet handle pointers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373838 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-06 01:37:35 +00:00
Matt Arsenault
fa3f3e76a0 GlobalISel: Implement widenScalar for G_SITOFP/G_UITOFP sources
Legalize 16-bit G_SITOFP/G_UITOFP for AMDGPU.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373287 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-01 01:06:48 +00:00
Amara Emerson
4818f426ab Add an operand to memory intrinsics to denote the "tail" marker.
We need to propagate this information from the IR in order to be able to safely
do tail call optimizations on the intrinsics during legalization. Assuming
it's safe to do tail call opt without checking for the marker isn't safe because
the mem libcall may use allocas from the caller.

This adds an extra immediate operand to the end of the intrinsics and fixes the
legalizer to handle it.

Differential Revision: https://reviews.llvm.org/D68151

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373140 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-28 05:33:21 +00:00
Amara Emerson
bb0fdfda6f [GlobalISel] Defer setting HasCalls on MachineFrameInfo to selection time.
We currently always set the HasCalls on MFI during translation and legalization if
we're handling a call or legalizing to a libcall. However, if that call is later
optimized to a tail call then we don't need the flag. The flag being set to true
causes frame lowering to always save and restore FP/LR, which adds unnecessary code.

This change does the same thing as SelectionDAG and ports over some code that scans
instructions after selection, using TargetInstrInfo to determine if target opcodes
are known calls.

Code size geomean improvements on CTMark:
 -O0 : 0.1%
 -Os : 0.3%

Differential Revision: https://reviews.llvm.org/D67868

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372443 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-20 23:52:07 +00:00
Amara Emerson
e5fe899c4b [GlobalISel] Partially revert r371901.
r371901 was overeager and widenScalarDst() and the like in the legalizer
attempt to increment the insert point given in order to add new instructions
after the currently legalizing inst. In cases where the insertion point is not
exactly the current instruction, then callers need to de-compensate for the
behaviour by decrementing the insertion iterator before calling them. It's not
a nice state of affairs, for now just undo the problematic parts of the change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372050 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-16 23:46:03 +00:00
Amara Emerson
233794f3c7 [GlobalISel] Fix insertion point of new instructions to be after PHIs.
For some reason we sometimes insert new instructions one instruction before
the first non-PHI when legalizing. This can result in having non-PHI
instructions before PHIs, which mean that PHI elimination doesn't catch them.

Differential Revision: https://reviews.llvm.org/D67570

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371901 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 21:49:24 +00:00
Jessica Paquette
23e464e395 [AArch64][GlobalISel] Tail call memory intrinsics
Because memory intrinsics are handled differently than other calls, we need to
check them for tail call eligiblity in the legalizer. This allows us to still
inline them when it's beneficial to do so, but also tail call when possible.

This adds simple tail calling support for when the intrinsic is followed by a
return.

It ports the attribute checks from `TargetLowering::isInTailCallPosition` into
a similarly-named function in LegalizerHelper.cpp. The target-specific
`isUsedByReturnOnly` hook is not ported here.

Update tailcall-mem-intrinsics.ll to show that GlobalISel can now tail call
memory intrinsics.

Update legalize-memcpy-et-al.mir to have a case where we don't tail call.

Differential Revision: https://reviews.llvm.org/D67566

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371893 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 20:25:58 +00:00
Matt Arsenault
bf6eeaf07e AMDGPU/GlobalISel: Legalize G_FMAD
Unlike SelectionDAG, treat this as a normally legalizable operation.
In SelectionDAG this is supposed to only ever formed if it's legal,
but I've found that to be restricting. For AMDGPU this is contextually
legal depending on whether denormal flushing is allowed in the use
function.

Technically we currently treat the denormal mode as a subtarget
feature, so custom lowering could be avoided. However I consider this
to be a defect, and this should be contextually dependent on the
controllable rounding mode of the parent function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371800 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 00:44:35 +00:00
Matt Arsenault
60dc45e8cb GlobalISel: Add G_FMAD instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371254 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-06 20:49:10 +00:00
Matt Arsenault
b171b8eace GlobalISel: Add basic legalization for G_BITREVERSE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370979 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-04 20:46:15 +00:00
Amara Emerson
707116e84d [GlobalISel] Fix G_SEXT narrowScalar to bail out of unsupported type combination.
Similar to the issue with G_ZEXT that was fixed earlier, this is a quick
to fall back if the source type is not exactly half of the dest type.

Fixes the clang-cmake-aarch64-lld bot build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370847 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-04 07:58:45 +00:00
Amara Emerson
3b8e736c58 [AArch64][GlobalISel] Legalize 128 bit divisions to libcalls.
Now that we have the infrastructure to support s128 types as parameters
we can expand these to libcalls.

Differential Revision: https://reviews.llvm.org/D66185

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370823 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-03 21:42:32 +00:00
Amara Emerson
1bf05b0927 [AArch64][GlobalISel] Fix zext narrowScalar to use the right type when creating
the merges.

Fixes PR43171.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370627 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-02 08:18:55 +00:00
Petar Avramovic
549868db40 [MIPS GlobalISel] Lower fptoui
Add lower for G_FPTOUI. Algorithm is similar to the SDAG version
in TargetLowering::expandFP_TO_UINT.
Lower G_FPTOUI for MIPS32.

Differential Revision: https://reviews.llvm.org/D66929


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370431 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-30 05:44:02 +00:00
Amara Emerson
2aad0c1894 [GlobalISel] Replace hard coded dynamic alloca handling with G_DYN_STACKALLOC.
This change moves the actual stack pointer manipulation into the legalizer,
available to targets via lower(). The codegen is slightly different because
we're using explicit masks instead of G_PTRMASK, and using G_SUB rather than
adding a negative amount via G_GEP.

Differential Revision: https://reviews.llvm.org/D66678

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370104 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-27 19:54:27 +00:00
Petar Avramovic
e412f89cbd [GlobalISel] Factor narrowScalar for G_ASHR and G_LSHR. NFC
Main difference is in the way Hi for Long shift (HiL) is made.
G_LSHR fills HiL with zeros, while G_ASHR fills HiL with sign bit value.

Differential Revision: https://reviews.llvm.org/D66589


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370064 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-27 14:33:05 +00:00
Petar Avramovic
c87132ea2d [GlobalISel] Fix narrowScalar for shifts to match algorithm from SDAG
Fix typos. Use Hi and Lo prefixes for Or instead of LHS and RHS
to match names of surrounding variables.

Differential Revision: https://reviews.llvm.org/D66587


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370062 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-27 14:22:32 +00:00
Matt Arsenault
06bdf458f3 GlobalISel: Don't create G_UADDE with constant false carry in
The x86 tests are now broken (in paticular add-scalar.ll now hits the
DAG fallback) due to not handling G_UADDO. The DAG x86 backend has a
custom lowering for this, so that will need to be implemented.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369673 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-22 17:29:17 +00:00
Matt Arsenault
7c120abd60 GlobalISel: Implement moreElementsVector for G_UNMERGE_VALUES sources
This is necessary for handling <3 x s16> on AMDGPU, assuming this
should be handled as 2 separate legalization actions. The alternative
would be for fewerElementsVector to handle 3->2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369547 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-21 16:59:10 +00:00
Petar Avramovic
38f2f8c831 [MIPS GlobalISel] NarrowScalar G_TRUNC
Add NarrowScalar for G_TRUNC when NarrowTy is half the size of source.
NarrowScalar G_TRUNC to s32 for MIPS32.

Differential Revision: https://reviews.llvm.org/D66202


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369509 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-21 09:26:39 +00:00
Amara Emerson
4e6cb18b4b [AArch64][GlobalISel] Add support for narrowScalar of G_ZEXT
We do this by merging the source with the high bits set to 0.

Differential Revision: https://reviews.llvm.org/D66181

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369480 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-21 00:12:37 +00:00
Amara Emerson
8b1cf714be [AArch64][GlobalISel] Lower G_SHUFFLE_VECTOR with 1 elt src and 1 elt mask.
Again, it's weird that these are allowed. Since lowering support was added in
r368709 we started crashing on compiling the neon intrinsics test in the test
suite. This fixes the lowering to fold the 1 elt src/mask case into copies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369135 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-16 18:06:53 +00:00
Aditya Nandakumar
fb900f7155 [GlobalISel]: Fix lowering of G_Shuffle_vector where we pick up the wrong source index
https://reviews.llvm.org/D66182

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368781 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 01:23:33 +00:00
Aditya Nandakumar
bb2cecc494 [GlobalISel]: Fix lowering of G_SHUFFLE_VECTOR with scalar sources
https://reviews.llvm.org/D66171

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368753 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-13 21:49:11 +00:00
Matt Arsenault
5508afab5c GlobalISel: Partially implement fewerElementsVector G_UNMERGE_VALUES
Odd sized vectors aren't handled yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368713 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-13 16:26:28 +00:00
Matt Arsenault
b5027beff2 GlobalISel: Implement lower for G_SHUFFLE_VECTOR
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368709 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-13 16:09:07 +00:00
Daniel Sanders
2d2b63fa73 [globalisel] Add G_SEXT_INREG
Summary:
Targets often have instructions that can sign-extend certain cases faster
than the equivalent shift-left/arithmetic-shift-right. Such cases can be
identified by matching a shift-left/shift-right pair but there are some
issues with this in the context of combines. For example, suppose you can
sign-extend 8-bit up to 32-bit with a target extend instruction.
  %1:_(s32) = G_SHL %0:_(s32), i32 24 # (I've inlined the G_CONSTANT for brevity)
  %2:_(s32) = G_ASHR %1:_(s32), i32 24
  %3:_(s32) = G_ASHR %2:_(s32), i32 1
would reasonably combine to:
  %1:_(s32) = G_SHL %0:_(s32), i32 24
  %2:_(s32) = G_ASHR %1:_(s32), i32 25
which no longer matches the special case. If your shifts and extend are
equal cost, this would break even as a pair of shifts but if your shift is
more expensive than the extend then it's cheaper as:
  %2:_(s32) = G_SEXT_INREG %0:_(s32), i32 8
  %3:_(s32) = G_ASHR %2:_(s32), i32 1
It's possible to match the shift-pair in ISel and emit an extend and ashr.
However, this is far from the only way to break this shift pair and make
it hard to match the extends. Another example is that with the right
known-zeros, this:
  %1:_(s32) = G_SHL %0:_(s32), i32 24
  %2:_(s32) = G_ASHR %1:_(s32), i32 24
  %3:_(s32) = G_MUL %2:_(s32), i32 2
can become:
  %1:_(s32) = G_SHL %0:_(s32), i32 24
  %2:_(s32) = G_ASHR %1:_(s32), i32 23

All upstream targets have been configured to lower it to the current
G_SHL,G_ASHR pair but will likely want to make it legal in some cases to
handle their faster cases.

To follow-up: Provide a way to legalize based on the constant. At the
moment, I'm thinking that the best way to achieve this is to provide the
MI in LegalityQuery but that opens the door to breaking core principles
of the legalizer (legality is not context sensitive). That said, it's
worth noting that looking at other instructions and acting on that
information doesn't violate this principle in itself. It's only a
violation if, at the end of legalization, a pass that checks legality
without being able to see the context would say an instruction might not be
legal. That's a fairly subtle distinction so to give a concrete example,
saying %2 in:
  %1 = G_CONSTANT 16
  %2 = G_SEXT_INREG %0, %1
is legal is in violation of that principle if the legality of %2 depends
on %1 being constant and/or being 16. However, legalizing to either:
  %2 = G_SEXT_INREG %0, 16
or:
  %1 = G_CONSTANT 16
  %2:_(s32) = G_SHL %0, %1
  %3:_(s32) = G_ASHR %2, %1
depending on whether %1 is constant and 16 does not violate that principle
since both outputs are genuinely legal.

Reviewers: bogner, aditya_nandakumar, volkan, aemerson, paquette, arsenm

Subscribers: sdardis, jvesely, wdng, nhaehnle, rovka, kristof.beyls, javed.absar, hiraditya, jrtc27, atanasyan, Petar.Avramovic, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61289

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368487 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-09 21:11:20 +00:00
Tim Northover
3c03681847 GlobalISel: pack various parameters for lowerCall into a struct.
I've now needed to add an extra parameter to this call twice recently. Not only
is the signature getting extremely unwieldy, but just updating all of the
callsites and implementations is a pain. Putting the parameters in a struct
sidesteps both issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368408 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-09 08:26:38 +00:00
Amara Emerson
c66f66b6b9 Re-commit "[GlobalISel] Add legalization support for non-power-2 loads and stores""
This is an old commit that exposed a bug in the GISel importer, which caused
non-truncating stores to be selected for truncating store patterns. Now that's
been fixed in r367737 this can go back in.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367739 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-02 23:44:24 +00:00
Matt Arsenault
abab6b93e0 GlobalISel: Lower scalarizing unmerge of a vector to shifts
AMDGPU sometimes has legal s16 and <2 x s16> operations, but all
registers are really 32-bit. An unmerge destination really should ben
widened to a 32-bit register. If widening a scalarizing vector with a
target size that matches the vector size, bitcast to integer and
extract the relevant bits with shifts.

I'm not sure if this is the right place for this. This could arguably
be part of widenScalar for the result. I also have a growing feeling
that we're missing a bitcast legalize action.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367604 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-01 19:10:05 +00:00
Matt Arsenault
074cd073b8 GlobalISel: Fix widenScalar for G_MERGE_VALUES to pointer
AMDGPU testcase isn't broken now, but will be in a future patch
without this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367591 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-01 18:13:16 +00:00
Matt Arsenault
9676b30e9f GlobalISel: moreElementsVector for G_LOAD/G_STORE
AMDGPU change and test is a placeholder until a future patch with
complete handling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367503 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-01 01:44:22 +00:00
Amara Emerson
5bd6d390dd [AArch64][GlobalISel] Implement narrowing of G_SEXT.
We need this to narrow a sext to s128.

Differential Revision: https://reviews.llvm.org/D65357

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367164 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-26 23:46:38 +00:00
Amara Emerson
2d9158da32 [AArch64][GlobalISel] Fix a crash during s128 G_ICMP legalization due to r366317.
r366317 added a legalization for s128 G_ICMP narrow scalar which tried to hard
code the result type of the new legalized G_SELECT. Change this to instead use
type of the original G_ICMP result and allow the target to legalize it if necessary
later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366943 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-24 20:46:42 +00:00
Amara Emerson
864028d509 [GlobalISel] Translate calls to memcpy et al to G_INTRINSIC_W_SIDE_EFFECTs and legalize later.
I plan on adding memcpy optimizations in the GlobalISel pipeline, but we can't
do that unless we delay lowering to actual function calls. This patch changes
the translator to generate G_INTRINSIC_W_SIDE_EFFECTS for these functions, and
then have each target specify that using the new custom legalizer for intrinsics
hook that they want it expanded it a libcall.

Differential Revision: https://reviews.llvm.org/D64895

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366516 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-19 00:24:45 +00:00
Matt Arsenault
c23172f64e GlobalISel: Handle widenScalar of arbitrary G_MERGE_VALUES sources
Extract the sources to the GCD of the original size and target size,
padding with implicit_def as necessary.

Also fix the case where the requested source type is wider than the
original result type. This was ignoring the type, and just using the
destination. Do the operation in the requested type and truncate back.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366367 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-17 20:22:44 +00:00
Matt Arsenault
873bfe9bdf GlobalISel: Handle more cases for widenScalar of G_MERGE_VALUES
Use an anyext to the requested type for the leftover operand to
produce a slightly wider type, and then truncate the final merge.

I have another implementation almost ready which handles arbitrary
widens, but I think it produces worse code in this example (which I
think is 90% due to not folding redundant copies or folding out
implicit_def users), so I wanted to add this as a baseline first.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366366 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-17 20:22:38 +00:00
Petar Avramovic
a3dad916d6 [MIPS GlobalISel] ClampScalar and select pointer G_ICMP
Add narrowScalar to half of original size for G_ICMP.
ClampScalar G_ICMP's operands 2 and 3 to to s32.
Select G_ICMP for pointers for MIPS32. Pointer compare is same
as for integers, it is enough to declare them as legal type.

Differential Revision: https://reviews.llvm.org/D64856


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366317 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-17 12:08:01 +00:00
Matt Arsenault
7835305a0d GlobalISel: Implement narrowScalar for vector extract/insert indexes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366113 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-15 19:37:34 +00:00
Fangrui Song
727b16e096 Delete dead stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365903 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-12 14:58:15 +00:00
Matt Arsenault
2e07d5cebb GlobalISel: Legalization for G_FMINNUM/G_FMAXNUM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365658 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-10 16:31:19 +00:00
Matt Arsenault
13b473d248 GlobalISel: Implement lower for G_FCOPYSIGN
In SelectionDAG AMDGPU treated these as legal, but this was mostly
because the bitcasts required for FP types were painful. Theoretically
the bitpattern should eventually match to bfi, so don't bother trying
to get the patterns to import.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365583 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-09 23:34:29 +00:00
Petar Avramovic
47da14c083 [MIPS GlobalISel] Register bank select for G_PHI. Select i64 phi
Select gprb or fprb when def/use register operand of G_PHI is
used/defined by either:
 copy to/from physical register or
 instruction with only one mapping available for that use/def operand.

Integer s64 phi is handled with narrowScalar when mapping is applied,
produced artifacts are combined away. Manually set gprb to all register
operands of instructions created during narrowScalar.

Differential Revision: https://reviews.llvm.org/D64351


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365494 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-09 14:36:17 +00:00
Matt Arsenault
5213f3c6ea GlobalISel: widenScalar for G_BUILD_VECTOR
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365320 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-08 13:48:06 +00:00
Matt Arsenault
d562a5618a GlobalISel: Fix widenScalar for pointer typed G_MERGE_VALUES
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365093 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-03 23:08:06 +00:00
Matt Arsenault
689a3451a4 GlobalISel: Try to widen merges with other merges
If the requested source type an be used as a merge source type, create
a merge of merges. This avoids creating large, illegal extensions and
bit-ops directly to the result type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364841 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-01 19:36:10 +00:00
Aditya Nandakumar
c2568f1080 [GlobalISel]: Allow backends to custom legalize Intrinsics
https://reviews.llvm.org/D31359

Add a hook "legalizeInstrinsic" to allow backends to override this
and custom lower/legalize intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364821 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-01 17:53:50 +00:00