[llvm-dev] Adding BB input/output registers during ISel

Tyler Kenney via llvm-dev llvm-dev at lists.llvm.org
Wed Jun 1 11:27:05 PDT 2016


Tim,

Thanks for the response. Since I started this project I've become quite
familiar with isel for single basic blocks but moving up a level and
looking at CFGs and multi-BB functions is a bit new to me, so I really
appreciate the feedback.

I've got a few questions on your example if you don't mind:

	1.) Can you provide another example of a BB that would have an
unreferenced live-in live-out var without making a function call? My target
is an embedded chip and, at least for the foreseeable future, we do not
intend to support function calls. It's inline everything or bust (which I
believe is also how the AMD GPU backend functions?). Although I don't
really want to eliminate the possibility of supporting function calls down
the line, this particular example is not my highest concern at the moment
if I could catch it and throw an error in this case, that would be OK.

	2.) What is the problem with having a basic-block that ignores an
unreferenced live-in, live out? I am sure that will cause an issue, but I'd
like to understand a little better what the issue will be. To put it
another way, what would happen if I was somehow able to surgically remove
res as a live-in & live-out from the BB calling bar() in your example, but
change nothing else?

	3.) Just to make sure I understand, I assume you would say the
following has the opposite problem:

	 I'd like to add this newly-created big vector value as an input reg
for all BBs in the func except the one that contains its LIFETIME_START
node, and I'd like to add it as an output reg for all BBs in the func
except the one that does not contain its LIFETIME_END node.

	That has the problem that I may add the inputs & outputs to BBs that
shouldn't have them, right? Again, do you know how this issue would
manifest itself?


	4.) More generic LLVM question here: is there any sort of convention
for distinguishing between live-ins/outs for a func and live-ins/outs for a
BB? It seems like most of the time I see those terms they're referring to
function live-ins/outs, but not always.


Tyler




From:	Tim Northover <t.p.northover at gmail.com>
To:	Tyler Kenney/Marlborough/IBM at IBMUS
Cc:	LLVM Developers Mailing List <llvm-dev at lists.llvm.org>
Date:	06/01/2016 12:25 PM
Subject:	Re: [llvm-dev] Adding BB input/output registers during ISel



On 1 June 2016 at 08:13, Tyler Kenney via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> I'd like to
> add this newly-created big vector value as an input reg for all BBs that
> reference the original stack object but do not contain it's
LIFETIME_START
> node, and I'd like to add it as an output reg for all BBs that reference
the
> original stack object but do not contain it's LIFETIME_END node.

This doesn't sound sufficient. For example:

    int foo(int res, int tst) {
      if (tst) bar();
      return res;
    }

Whatever register contains "res" is also a live-in & out for the
basic-block calling bar even though it's not referenced there. I think
you need some kind of real CFG analysis.

Tim.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160601/a099d0e1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160601/a099d0e1/attachment.gif>


More information about the llvm-dev mailing list