[llvm-commits] PR8932

Frits van Bommel fvbommel at gmail.com
Mon Jan 10 10:13:32 PST 2011


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