If the extractelement instruction is used multiple times in the
different tree entries (either vectorized, or gathered), need to
compensate the scalar cost of such instructions. They are completely
removed if all users are part of the tree but we need to compensate the
cost only once for each instruction.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
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 it processes 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
Comment Actions
Hi, committed a101a9b64b31ed20e4d18c2e395b0a3742ad1836 yesterday to fix it, could you try to update your compiler?