[RFC] Remove User::OperandList

Pete Cooper peter_cooper at apple.com
Wed Jun 10 13:23:04 PDT 2015


Hi Duncan

Here’s the updated patches.  I didn’t make any changes outside of your feedback to 0001-0005 so they can probably be ignored.  I’m working on using clang-format now then will commit those ones.

I reorganised 0006-0009 to try make them ordered better.

0006 and 0007 are now just refactoring num operands and get/set operand list.  I added the assert for out of range num operands to 0006.

0008 was 0006 before.  It adds the new version of operator new, but this time i’ve cleaned it up more as the num uses was 0.
0009 is now last as it was the real change in behavior for this whole series.

Cheers,
Pete


> On Jun 10, 2015, at 10:15 AM, Pete Cooper <peter_cooper at apple.com> wrote:
> 
> Actually, looking at 0006 more, I think you’re right that I made too small a change.
> 
> Folding away ‘Us' being 0 in the new operator new makes sense.  The operand list should be a nullptr after this, something i can assert in allocHungOffUses, and the call to Use::init(Start, End) wasn’t doing anything as we had no uses.  I’ll fold all that cleanup in to 0006, and the remainder will be in 0008.
> 
> Cheers,
> Pete
>> On Jun 9, 2015, at 10:38 PM, Pete Cooper <peter_cooper at apple.com <mailto:peter_cooper at apple.com>> wrote:
>> 
>>> This logic looks all wrong to me.  Firstly, `Us` is always 0, so you can
>>> factor it out.
>>> 
>>> More importantly, why are you co-allocating a `Use`, when the uses are
>>> hung-off?  Shouldn't this co-allocate a `Use*`, if anything?  Or does
>>> that wait for 0008?
>>> 
>>> It also seems strange/wrong to be pointing `OperandList` at anything
>>> here -- I feel like it should start out as `nullptr`.
>>> 
>>> Maybe this would make more sense squashed with 0008.  Let me know if I'm
>>> just missing something, too.
>> Yeah, i should have explained this one better.  Ultimately i was trying to move all the hung off subclasses to the new version of operator new without any other changes in behavior.  Given that they all used to call new(size, 0), i made this version of new initially do exactly that and have the 0 too.
>> 
>> This version of new does set the HasHungOffUses boolean to true so as to allow the asserts that we only use the hung off uses methods when allowed.
>> 
>> Would you prefer I squash it, improve the commit comments, or leave it as is given the explanation here?  I can also elaborate more if i didn’t explain it well.
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150610/e9f8e241/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Move-the-special-Phi-logic-for-hung-off-uses-in-to-U.patch
Type: application/octet-stream
Size: 4073 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150610/e9f8e241/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150610/e9f8e241/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Make-User-track-whether-a-class-has-hung-off-uses-an.patch
Type: application/octet-stream
Size: 4654 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150610/e9f8e241/attachment-0001.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150610/e9f8e241/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Delete-User-dropHungOffUses-and-move-it-in-to-User-w.patch
Type: application/octet-stream
Size: 4544 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150610/e9f8e241/attachment-0002.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150610/e9f8e241/attachment-0003.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Add-User-growHungoffUses-and-use-it-to-grow-the-hung.patch
Type: application/octet-stream
Size: 4913 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150610/e9f8e241/attachment-0003.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150610/e9f8e241/attachment-0004.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-Stop-returning-a-Use-from-allocHungOffUses.patch
Type: application/octet-stream
Size: 6333 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150610/e9f8e241/attachment-0004.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150610/e9f8e241/attachment-0005.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-Replace-all-accesses-to-User-OperandList-with-getter.patch
Type: application/octet-stream
Size: 11888 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150610/e9f8e241/attachment-0005.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150610/e9f8e241/attachment-0006.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-Rename-NumOperands-to-make-it-clear-its-managed-by-t.patch
Type: application/octet-stream
Size: 17158 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150610/e9f8e241/attachment-0006.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150610/e9f8e241/attachment-0007.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0008-Added-a-version-of-User-new-for-hung-off-uses.patch
Type: application/octet-stream
Size: 5168 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150610/e9f8e241/attachment-0007.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150610/e9f8e241/attachment-0008.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0009-Move-OperandList-to-be-allocated-prior-to-User-for-h.patch
Type: application/octet-stream
Size: 6194 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150610/e9f8e241/attachment-0008.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150610/e9f8e241/attachment-0009.html>


More information about the llvm-commits mailing list