[llvm-dev] Node deletion during DAG Combination ?

Dominique Torette via llvm-dev llvm-dev at lists.llvm.org
Wed Jun 20 07:09:15 PDT 2018


Tim wrote:
> -----Original Message-----
> From: Tim Northover [mailto:t.p.northover at gmail.com]
> Sent: mercredi 20 juin 2018 11:13
> To: Dominique Torette
> Cc: LLVM Developers Mailing List
> Subject: Re: [llvm-dev] Node deletion during DAG Combination ?
>
> So there are 3 steps:
>
> 1. Add the incoming chain of the load you highlighted as an operand to
> this new combined node.
> 2. Create the combined node with an output chain too (essentially just
> an extra MVT::Other output value).

Steps 1 and 2 have been implemented. t72 has now Chain output.

    t73: ch = CLPISD::STORE_VECTOR_INSERT_oo t53:1, FrameIndex:i16<1>, t53, Constant:i16<1>
  t57: v2f32,ch = load<Volatile LD8[%l1]> t73, FrameIndex:i16<0>, undef:i16
                    t58: v2f32,ch = load<Volatile LD8[%l1]> t57:1, FrameIndex:i16<0>, undef:i16
                    t72: f32,ch = CLPISD::LOAD_VECTOR_EXTRACT_o t57:1, FrameIndex:i16<0>, Constant:i16<0>
                  t62: ch = llvm.clp.writeapb.f32 t58:1, TargetConstant:i16<397>, Constant:i32<24575>, t72

> 3. Manually call SelectionDAG::ReplaceAllUsesWith to replace all uses
> of the load node's chain with this new one because the generic
> combining logic only knows about the extract being combined. It can't
> automatically tell you've also fiddled about with a load further up
> the DAG.

SelectionDAG::ReplaceAllUsesWith() was the API I was looking for…
But I have a problem with the 3 implementations of the SelectionDAG::ReplaceAllUsesWith().
They checks somehow the congruency of the returned values types….
t58 returns first a v2f32 while t72 return first a f32 ! This raises assertion. ☹
I understand such type constraint for general substitution, but in this case the only reference to t58 is the chain from t62.




 ------------------------------------------------------------------------------

E-MAIL DISCLAIMER

The present message may contain confidential and/or legally privileged information. If you are not the intended addressee and in case of a transmission error, please notify the sender immediately and destroy this E-mail. Disclosure, reproduction or distribution of this document and its possible attachments is strictly forbidden.

SPACEBEL denies all liability for incomplete, improper, inaccurate, intercepted, (partly) destroyed, lost and/or belated transmission of the current information given that unencrypted electronic transmission cannot currently be guaranteed to be secure or error free.
Upon request or in conformity with formal, contractual agreements, an originally signed hard copy will be sent to you to confirm the information contained in this E-mail.

SPACEBEL denies all liability where E-mail is used for private use.

SPACEBEL cannot be held responsible for possible viruses that might corrupt this message and/or your computer system.
 -------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180620/a93ee146/attachment.html>


More information about the llvm-dev mailing list