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

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 4 18:55:18 PST 2016


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
> 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
>
> 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
>
> ==============================================================================
> --- 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160204/e702e9be/attachment.html>


More information about the llvm-commits mailing list