Peter Lawrence via llvm-dev
2017-Jun-22 17:13 UTC
[llvm-dev] re: How to deal with UNDEF SDNode?
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>
Hi Peter, 2017-06-23 1:13 GMT+08:00 Peter Lawrence via llvm-dev < llvm-dev at lists.llvm.org>:> 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. >So the UNDEF node corresponds to undefined value in LLVM LangRef [1], right? And I can do whatever I want with those UNDEF nodes, right? Thanks. [1] http://llvm.org/docs/LangRef.html#undefined-values Regards, chenwj -- Wei-Ren Chen (陳韋任) Homepage: https://people.cs.nctu.edu.tw/~chenwj -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170623/ae4b496f/attachment.html>