Closed AinsleySnow closed 8 months ago
The following tests crashed in my environment:
Clang :: Driver/baremetal.cpp
Clang :: Driver/csky-toolchain.c
Clang :: Driver/freebsd-include-paths.c
Clang :: Driver/haiku.c
Clang :: Driver/hexagon-toolchain-linux.c
Clang :: Driver/riscv32-toolchain-extra.c
Clang :: Driver/riscv64-toolchain-extra.c
Clang :: Driver/solaris-ld.c
Clang :: Modules/embed-files-compressed.cpp
Clang :: OpenMP/declare_variant_device_isa_codegen_1.c
LLVM :: CodeGen/Generic/live-debug-label.ll
But they still crash even without this patch. Maybe we need a ci to run the tests, just like what we do in ruyisdk.
This patch migrate two commit implementing the vector predication pass from LLVM bpEVL.
The two commits is based on the loop vectorizer one year ago, but now details of loop vectorizer changed and some code in these commits must be changed accordingly.
Modification to VPIntrinsics.def introduced by bpevl is dropped, because #66199 already added the same defination.
D158779 simplified the logic of
addCanonicalIVRecipes
, and move part of its code toaddVPLaneMaskPhiAndUpdateExitBranch
. Since the first commit has something to do with the moved logic, I modified the prototype ofaddActiveLaneMask
,addVPLaneMaskPhiAndUpdateExitBranch
and letaddCanonicalIVRecipes
returnNextEVL
to make sureNextEVL
is insert to the exiting block as in the origin commit.D147964 deleted the loop for setting
TripCount
in the start ofVPlan::prepareToExecute
(VPlan.cpp, line 616-621), therefore code in the first commit accessing trip count throughState.get
(example) will get undesired result and eventually crash the program. So I modified the code to getTripCount
stored in the recipes directly (VPlanRecipes.cpp, line 1829 and VPlanRecipes.cpp, line 447).#74761 remove the
CanonicalIVIncrement
VPInstruction (link) and useadd
instruction instead but part of the logic of the first commit relies on it. So I modified the processing logic of binary operator (VPlan.cpp, line 284-295) to add them.Finally I updated
vp_intrinsics.ll
. The changes are likely introduced by other changes of LV but not by mistakes in migration.