1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00
Artyom Skrobov d5f3afc063 Adding support for TargetLoweringBase::LibCall
Summary:
TargetLoweringBase::Expand is defined as "Try to expand this to other ops,
otherwise use a libcall." For ISD::UDIV and ISD::SDIV, the choice between
the two possibilities was defined in a rather convoluted way:

- if DIVREM is legal, expand to DIVREM
- if DIVREM has a custom lowering, expand to DIVREM
- if DIVREM libcall is defined and a remainder from the same division is
  computed elsewhere, expand to a DIVREM libcall
- else, expand to a DIV libcall

This had the undesirable effect that if both DIV and DIVREM are implemented
as libcalls, then ISD::UDIV and ISD::SDIV are expanded to the heavier DIVREM
libcall, even when the remainder isn't used.

The new code adds a new LegalizeAction, TargetLoweringBase::LibCall, so that
backends can directly control whether they prefer an expansion or a conversion
to a libcall. This makes the generic lowering code even more generic,
allowing its reuse in a wider range of target-specific configurations.

The useful effect is that ARM backend will now generate a call
to __aeabi_{i,u}div rather than __aeabi_{i,u}divmod in cases where
it doesn't need the remainder. There's no functional change outside
the ARM backend.

Reviewers: t.p.northover, rengolin

Subscribers: t.p.northover, llvm-commits, aemerson

Differential Revision: http://reviews.llvm.org/D13862

llvm-svn: 250826
2015-10-20 13:14:52 +00:00
..
2015-10-09 03:19:03 +00:00
2014-04-03 17:35:22 +00:00
2014-09-02 22:45:13 +00:00
2012-06-11 08:07:26 +00:00
2014-02-16 07:31:05 +00:00
2014-08-26 12:47:26 +00:00
2014-01-29 11:50:56 +00:00
2014-01-29 11:50:56 +00:00
2015-08-19 01:44:51 +00:00
2014-04-25 17:51:25 +00:00
2014-11-17 14:08:57 +00:00
2014-04-03 17:35:22 +00:00
2014-04-03 17:35:22 +00:00
2012-09-29 21:43:49 +00:00
2014-12-04 19:34:50 +00:00
2014-08-20 10:40:20 +00:00
2014-04-03 17:35:22 +00:00
2014-04-03 17:35:22 +00:00
2015-01-19 15:16:06 +00:00
2014-04-03 17:35:22 +00:00
2014-04-23 01:09:29 +00:00
2014-01-24 17:20:08 +00:00
2015-08-13 17:28:16 +00:00