[PATCH] D114958: [SLP]Fix reused extracts cost.

Qiongsi Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 7 07:33:59 PST 2021


qiongsiwu1 added a comment.

In D114958#3176411 <https://reviews.llvm.org/D114958#3176411>, @ABataev wrote:

> In D114958#3176403 <https://reviews.llvm.org/D114958#3176403>, @qiongsiwu1 wrote:
>
>> This patch causes a crash when compiling the IR below.
>>
>>   define dso_local void @foo() local_unnamed_addr {
>>   entry:
>>     %0 = extractelement <2 x double> undef, i32 1
>>     br label %loop_do_
>>   
>>   loop_do_:
>>     %a1 = phi double [ %a1, %loop_do_ ], [ %0, %entry ]
>>     %a2 = phi double [ undef, %loop_do_ ], [ undef, %entry ]
>>     br label %loop_do_
>>   }
>>
>> The patch moved the `isSlat(VL)` check after we process `ExtractValue`, but this test case has a tree where one value is `undef`, and the other is an `extractvalue`. Should we match not only `isa<ExtractElementInst, UndefValue>(V)`, but also an undef value itself as well?
>>
>> Thanks a lot! FYI @RolandF
>
> Hi, committed a101a9b64b31ed20e4d18c2e395b0a3742ad1836 <https://reviews.llvm.org/rGa101a9b64b31ed20e4d18c2e395b0a3742ad1836> yesterday to fix it, could you try to update your compiler?

Ah great! Thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114958



More information about the llvm-commits mailing list