[llvm-dev] re: How to deal with UNDEF SDNode?

Peter Lawrence via llvm-dev llvm-dev at lists.llvm.org
Thu Jun 22 10:13:27 PDT 2017


Chenwj,
             In ISD the UNDEF node (i.e. SDValue) is an "undefined value”,
not “undefined behavior”, i.e. not scary!. You can think of it as an
uninitialized / don’t-care register, or in a vector an uninitialized / don’t-care element.

Peter Lawrence.

> On Jun 22, 2017, at 8:35 AM, via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Date: Thu, 22 Jun 2017 21:21:09 +0800
> Subject: [llvm-dev] How to deal with UNDEF SDNode?
> 
> 
> Hi All,
> 
>  The comment of UNDEF in ISDOpcodes.h [1] is pretty simple,
> 
>      /// UNDEF - An undefined node.
> 
>      UNDEF,
> The name make me think of C undefined behavior, which is ... scary. But I
> also see there are
> APIs like isBuildVectorAllOnes, isBuildVectorAllZeros, ... etc, seems UNDEF
> just can be any
> value and we don't care about what it is. The most case I see UNDEF is in
> BUULD_VECTOR,
> VECTOR_SHUFFLE, ... etc. I would like to know usually how we deal with
> those UNDEF nodes?
> 
> Thanks.
> 
> [1] http://llvm.org/doxygen/ISDOpcodes_8h_source.html <http://llvm.org/doxygen/ISDOpcodes_8h_source.html>
> 
> Regards,
> chenwj
> 
> -- 
> Wei-Ren Chen (陳韋任)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170622/fad8f3ed/attachment.html>


More information about the llvm-dev mailing list