Re: [PATCH] x86: Optimize variable_test_bit()

From: Vladimir Makarov
Date: Fri May 01 2015 - 15:03:21 EST




On 01/05/15 12:33 PM, Jakub Jelinek wrote:
On Fri, May 01, 2015 at 09:03:32AM -0700, Linus Torvalds wrote:
PPS. Jakub, I see gcc5.1 still hasn't got output operands for asm goto;
is this something we can get 'fixed' ?
CCing Richard as author of asm goto and Vlad as register allocator
maintainer. There are a few enhancement requests to support this, like
http://gcc.gnu.org/PR59615 and http://gcc.gnu.org/PR52381 , but indeed the
reason why no outputs are allowed is the register allocation issue.
Don't know if LRA would be better suited to handle that case, but it would
indeed be pretty hard.


GCC RA is a major reason to prohibit output operands for asm goto.

Reload pass was not designed to deal with output reloads for control
flow insns. It is very hard to implement this feature there and
implement it in a reliable way. Also nobody does any development for
reload for long time. So I doubt that somebody would do this for reload.

LRA is more suitable to implement the feature. In general, even
outputs used on any branch can be permitted. Although critical edges
can complicate the implementation as new BBs are created. But it is
doable too.

The only problem is that asm goto semantics in this case should be
defineddepending on what local register allocator (reload or LRA) GCC
for given target use.

Currently LRA is used by x86/x86-64, ARM, AARCH64, s390, and MIPS.
PPC, SH, and ARC are moving to LRA. All other targets are still
reload based.

So I could implement the output reloads in LRA, probably for the
next GCC release. How to enable and mostly use it for multi-target
code like the kernel is another question.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/