[PATCH] D142589: [LV] Perform recurrence sinking directly on VPlan.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 13 13:28:11 PST 2023


fhahn added a comment.

In D142589#4123450 <https://reviews.llvm.org/D142589#4123450>, @ashay-github wrote:

>> could you try to see if the following patch fixes the issue:
>
> Unfortunately, that didn't fix it.  I see the call to `stable_sort` in the stack trace, but other than that, it's the same as before:
>
>   #0 0x00007ff662b7ce6a std::_Debug_lt_pred<`sinkRecurrenceUsersAfterPrevious'::`2'::<lambda_2> &,llvm::VPRecipeBase * &,llvm::VPRecipeBase * &,0> C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xutility:1096:0
>   
>   #1 0x00007ff662bb23ba std::_Insertion_sort_unchecked<llvm::VPRecipeBase * *,`sinkRecurrenceUsersAfterPrevious'::`2'::<lambda_2> > C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\algorithm:7519:0
>                                                                                  
>   #2 0x00007ff662c1da94 std::stable_sort<llvm::VPRecipeBase * *,`sinkRecurrenceUsersAfterPrevious'::`2'::<lambda_2> > C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\algorithm:8075:0
>   
>   #3 0x00007ff662ba07f1 llvm::stable_sort<llvm::SmallVector<llvm::VPRecipeBase *,6> &,`sinkRecurrenceUsersAfterPrevious'::`2'::<lambda_2> > llvm-project\llvm\include\llvm\ADT\STLExtras.h:1955:0
>   
>   #4 0x00007ff6664948c3 sinkRecurrenceUsersAfterPrevious llvm-project\llvm\lib\Transforms\Vectorize\VPlanTransforms.cpp:619:0
>
> I pasted the code from xutility where the crash occurs and it seems to think that the comparator is invalid.  Does that provide any hints / clues?

Thanks for sharing the additional info. I think this may be checking that the comparator doesn't return true for B < A if A < B. This can happen with the current comparator. I pushed a fix that uses `properlyDominates` to avoid this. Could you check if you still see the issue? If so, I'll revert the set of patches and will try to check this out on a Windows system,.Fix is 807d43239a5f <https://reviews.llvm.org/rG807d43239a5fe0bb93d64925393bb99abbd81a92>


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142589/new/

https://reviews.llvm.org/D142589



More information about the llvm-commits mailing list