[llvm-dev] A tagged architecture, the elephant in the undef / poison room

Sanjoy Das via llvm-dev llvm-dev at lists.llvm.org
Fri Jun 16 20:23:18 PDT 2017


Hi Peter,

On Tue, Jun 13, 2017 at 10:27 AM, Peter Lawrence via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Here’s what seems to really be going on
>
>         “undef”  ===  models an uninitialized register,  but

No, it specifically does not.  You yourself have mentioned the reason
many times -- every "read" of undef returns a new value, which is
different from, say, %rax with garbage in it.

>         “poison”  ===  turns the entire IR into a tagged architecture
>
>
> Is this really the way to go ?
>
> It seems like a odd choice given that none of our current targets
> are tagged architectures, all of this tagged IR has to somehow be
> reduced back down to normal target machine instructions.

No architecture (that I know of) supports PHI nodes either, yet they
are an enormously useful concept.  Comparing LLVM IR to machine ISAs
is a mistake -- the mid level IR should be evaluated in terms of how
well it can do what it is supposed to do, which is enable mid level
optimizations.  There's a reason why we don't use MCInsts all the way
through.

Thanks!
-- Sanjoy


More information about the llvm-dev mailing list