[llvm-commits] PR8932
Jakub Staszak
kubastaszak at gmail.com
Mon Jan 10 14:32:03 PST 2011
You are right. I didn't test it well, sorry :( Looking for the recursion in the types might be very time-consuming. Checking for the number of iterations however, might increase size of the code without any performance benefits.
On Jan 10, 2011, at 7:13 PM, Frits van Bommel wrote:
> On Mon, Jan 10, 2011 at 5:00 PM, Jakub Staszak <kubastaszak at gmail.com> wrote:
>> This is my proposed patch for pr8932.
>
> It doesn't look very generic to me.
> It only checks for cases like
> %0 = type { %0* }
> What about
> %0 = type %0*
> or
> %0 = type [1 x %0*]
> ?
>
> Nor does it catch cases like
> %0 = type { %1*, i32 }
> %1 = type { %0*, i8 }
>
>
> I think what you really want to be looking for is recursion in the types.
>
> One alternative approach might be to introduce a limit on the number
> of times a function can have its arguments promoted? Are there any
> cases where more than, say, 10 iterations on the same function is
> useful in practice? (The actual limit could be a command-line
> parameter defaulting to something reasonable)
> Though now that I think about it the limit would still cause the
> runOnSCC() to return true even if nothing actually changed, which may
> be undesirable.
>
> Yet another option might be to keep a set of types a function has had,
> and stop trying if the function has already had (or currently has) the
> type you're about to give it. Though that wouldn't catch the
> "recursive type with extra fields" case, I suppose...
More information about the llvm-commits
mailing list