Summary: This patch introduces an API to build and modify vector shapes. The validity of a VFShape can be checked with the `hasValidParameterList` method, which is also run in an assertion each time a VFShape is modified. The field VFISAKind has been moved to VFInfo under the assumption that different ISAs can map to the same VFShape (as it can be in the case of vector extensions with the same registers size, for example AVX and AVX2). Reviewers: sdesmalen, jdoerfert, simoll, hsaito Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70513
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 41284 Build 41478: arc lint + arc unit
Event Timeline
llvm/unittests/Analysis/VectorUtilsTest.cpp | ||
---|---|---|
315 | This should be /*Parameters*/, not /*HasGlobalPredicate*/. Same for all uses below. |
Fully implement and test the API.
This patch is ready to be reviewed.
Thanks,
Francesco
In this patch I have achieved better unit tests granularity by moving
the EXPECT_* macros from the test fixture class into the actual
test, so that in case of failure the log message points at the right
line in the code (otherwise it always points at the EXPECT_* in the
method used to run the check in the class definition of the test
fixture).
In this last update I have:
- Removed an assertion in updateParameter that was checking a condition for VFParamKind::GlobalPredicate already checked in hasValidParameterList.
- Renamed a method in the test for better readability of the code (from isValidParameterList to validParams).
Thanks,
Francesco
In this update I have removed empty statements in the tests. (facepalm)
Thanks,
Francesco
Update (and rename) the get method to use ElementCount instead of VF
and IsScalable separately.
llvm/include/llvm/Analysis/VectorUtils.h | ||
---|---|---|
83–85 | Notice that I am not using ElementCount here to realize VF and IsScalable because it would delete the default constructors associated to VFShape and VFInfo. |
llvm/include/llvm/Analysis/VectorUtils.h | ||
---|---|---|
91 | nit: can you add a newline between the previous and next method? | |
llvm/lib/Analysis/VectorUtils.cpp | ||
1189 | should this be an assert? | |
1191 | nit: can you add a newline above? | |
1192 | nit: Nothign -> Nothing | |
1222 | Can you add a function here that calculates this, per supported VFABI? | |
llvm/unittests/Analysis/VectorUtilsTest.cpp | ||
311 | nit: this could do with some newlines. |
Address review comments from @sdesmalen.
llvm/lib/Analysis/VectorUtils.cpp | ||
---|---|---|
1189 | I have updated also the tests replacing EXPECT_FALSE with EXPECT_DEATH, to make sure the assert is not removed. | |
1222 | Marking this as done as the most recent version of the patch doesn't have any concept for VFABI for GlobalPredicate, as the global predicate is allowed to be anywhere in the signature, as long as it is unique. |
Notice that I am not using ElementCount here to realize VF and IsScalable because it would delete the default constructors associated to VFShape and VFInfo.