[RFC] Remove User::OperandList

Pete Cooper peter_cooper at apple.com
Tue Jun 9 18:12:42 PDT 2015


Attached new versions of the patches based on both of your feedback.

0001 - unchanged
0002 - steal a bit from NumOperands instead of SubclassOptionalData
0003 - Delete the destructors too as ~PHINode for example was now empty
0004 - Renamed reallocHungOffUses to growHungoffUses
0005 - unchanged
0006 - Add User::new(size_t) instead of an override taking a bool.
0007 - unchanged
0008 - unchanged
0009 - unchanged

Comments appreciated.  

Also, if any of the earlier patches are ok and can be committed then that would be great so i don’t rebase too much.  0008 should be the only real difference.  Everything else is mostly refactoring.

Thanks,
Pete

-------------- 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: 4061 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150609/531fcd31/attachment.obj>
-------------- 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: 4554 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150609/531fcd31/attachment-0001.obj>
-------------- 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/20150609/531fcd31/attachment-0002.obj>
-------------- 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: 4901 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150609/531fcd31/attachment-0003.obj>
-------------- 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/20150609/531fcd31/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-Added-a-version-of-User-new-for-hung-off-uses.patch
Type: application/octet-stream
Size: 5402 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150609/531fcd31/attachment-0005.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-Replace-all-accesses-to-User-OperandList-with-getter.patch
Type: application/octet-stream
Size: 12550 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150609/531fcd31/attachment-0006.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0008-Move-OperandList-to-be-allocated-prior-to-User-for-h.patch
Type: application/octet-stream
Size: 6209 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150609/531fcd31/attachment-0007.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0009-Rename-NumOperands-to-make-it-clear-its-managed-by-t.patch
Type: application/octet-stream
Size: 17168 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150609/531fcd31/attachment-0008.obj>
-------------- next part --------------


> On Jun 1, 2015, at 9:53 AM, Pete Cooper <peter_cooper at apple.com> wrote:
> 
> 
>> On Jun 1, 2015, at 9:50 AM, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
>> 
>> 
>>> On 2015-May-29, at 10:35, Pete Cooper <peter_cooper at apple.com> wrote:
>>> 
>>> 
>>>> On May 29, 2015, at 10:31 AM, Owen Anderson <resistor at mac.com> wrote:
>>>> 
>>>>> Finally, fixed all callers of the User::new to call the correct version of the method.  This involved adding (unsigned) casts or changing for example 1 to 1U in callers to disambiguate the 'new' we want.
>>>> 
>>>> This seems kind of gross.  Is there any cleaner way to get the same effect?
>>> Yeah, I agree.  I considered just adding the bool to the end of the existing User::new and making it default to false.  Then I could assert in there that we ask for 0 Use’s if we need hung off uses.  That would mean I only need to rewrite the hung off use calls to new.
>> 
>> This rejected alternative sounds better to me.
>> 
>> Alternatively, you could avoid the `bool` altogether:
>> 
>>   /// Allocate a User with an operand pointer co-allocated.
>>   void *operator new(size_t Size);
>> 
>>   /// Allocate a User with the operands co-allocated.
>>   void *operator new(size_t Size, unsigned NumOps);
>> 
>> Then you also don't need an assertion.  Thoughts?
> Yeah, sounds good to be.  So long as I put a comment explaining that the default does the collocated Use* then i think it’ll be fine.
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list