[llvm] r259867 - [RS4GC] Pass DenseMap by reference, NFC

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 4 19:22:05 PST 2016


Ah, I see - sorry about that. Glanced and saw some non-const references in
the + lines, but didn't see that they weren't the ones being changed. Sorry
about that. Carry on.

On Thu, Feb 4, 2016 at 7:04 PM, Joseph Tremoulet <jotrem at microsoft.com>
wrote:

> Isn’t it const ref below?
>
> +    const RematerializedValueMapTy &RematerializedValues,
>
>
>
>
>
> *From:* David Blaikie [mailto:dblaikie at gmail.com]
> *Sent:* Thursday, February 4, 2016 9:55 PM
> *To:* Joseph Tremoulet <jotrem at microsoft.com>
> *Cc:* llvm-commits <llvm-commits at lists.llvm.org>
> *Subject:* Re: [llvm] r259867 - [RS4GC] Pass DenseMap by reference, NFC
>
>
>
> Should that be const ref? If it should be non-const ref, presumably
> there's some bug that you just fixed & perhaps we could have a test for
> that? (if side effect changes should be visible in the caller)
>
>
>
> On Thu, Feb 4, 2016 at 5:42 PM, Joseph Tremoulet via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
> Author: josepht
> Date: Thu Feb  4 19:42:52 2016
> New Revision: 259867
>
> URL: http://llvm.org/viewvc/llvm-project?rev=259867&view=rev
> <https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fllvm.org%2fviewvc%2fllvm-project%3frev%3d259867%26view%3drev&data=01%7c01%7cjotrem%40microsoft.com%7c0a64842462db4e391f5208d32dd7c825%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=ahyE9YKH1k3vfRJZLIksjOneJSzOxa7ZX%2ftN5jzgxb4%3d>
> Log:
> [RS4GC] Pass DenseMap by reference, NFC
>
> Summary:
> Passing the rematerialized values map to insertRematerializationStores by
> value looks to be a simple oversight; update it to pass by reference.
>
>
> Reviewers: reames, sanjoy
>
> Subscribers: llvm-commits
>
> Differential Revision: http://reviews.llvm.org/D16911
> <https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2freviews.llvm.org%2fD16911&data=01%7c01%7cjotrem%40microsoft.com%7c0a64842462db4e391f5208d32dd7c825%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=XQ3bGs7nr8glF8UQI2sHpvizCyiOrNJztbuvrQ2S8b0%3d>
>
> Modified:
>     llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
>
> Modified: llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp?rev=259867&r1=259866&r2=259867&view=diff
> <https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fllvm.org%2fviewvc%2fllvm-project%2fllvm%2ftrunk%2flib%2fTransforms%2fScalar%2fRewriteStatepointsForGC.cpp%3frev%3d259867%26r1%3d259866%26r2%3d259867%26view%3ddiff&data=01%7c01%7cjotrem%40microsoft.com%7c0a64842462db4e391f5208d32dd7c825%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=0W0h0n6v%2flqy8huCOKtzYiD88nC6YjEfD0H6rQ%2fgl7c%3d>
>
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp (original)
> +++ llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp Thu Feb
> 4 19:42:52 2016
> @@ -1617,11 +1617,10 @@ insertRelocationStores(iterator_range<Va
>
>  // Helper function for the "relocationViaAlloca". Similar to the
>  // "insertRelocationStores" but works for rematerialized values.
> -static void
> -insertRematerializationStores(
> -  RematerializedValueMapTy RematerializedValues,
> -  DenseMap<Value *, Value *> &AllocaMap,
> -  DenseSet<Value *> &VisitedLiveValues) {
> +static void insertRematerializationStores(
> +    const RematerializedValueMapTy &RematerializedValues,
> +    DenseMap<Value *, Value *> &AllocaMap,
> +    DenseSet<Value *> &VisitedLiveValues) {
>
>    for (auto RematerializedValuePair: RematerializedValues) {
>      Instruction *RematerializedValue = RematerializedValuePair.first;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
> <https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2flists.llvm.org%2fcgi-bin%2fmailman%2flistinfo%2fllvm-commits&data=01%7c01%7cjotrem%40microsoft.com%7c0a64842462db4e391f5208d32dd7c825%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=Ita2nfUjPgm%2beyi%2ba%2fbhMF78r%2fXQmW0fTeM8b3pB0Nk%3d>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160204/c19b53c2/attachment.html>


More information about the llvm-commits mailing list