forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SandboxVectorizer] New class to actually collect and manage seeds (l…
…lvm#112979) There are many more tests to add, but I would like to get this reviewed and the details sorted out before it grows too big.
- Loading branch information
1 parent
3acc58c
commit d91318b
Showing
4 changed files
with
292 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/VecUtils.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//===- VecUtils.h -----------------------------------------------*- C++ -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Collector for SandboxVectorizer related convenience functions that don't | ||
// belong in other classes. | ||
|
||
#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_VECUTILS_H | ||
#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_VECUTILS_H | ||
|
||
class Utils { | ||
public: | ||
/// \Returns the number of elements in \p Ty. That is the number of lanes if a | ||
/// fixed vector or 1 if scalar. ScalableVectors have unknown size and | ||
/// therefore are unsupported. | ||
static int getNumElements(Type *Ty) { | ||
assert(!isa<ScalableVectorType>(Ty)); | ||
return Ty->isVectorTy() ? cast<FixedVectorType>(Ty)->getNumElements() : 1; | ||
} | ||
/// Returns \p Ty if scalar or its element type if vector. | ||
static Type *getElementType(Type *Ty) { | ||
return Ty->isVectorTy() ? cast<FixedVectorType>(Ty)->getElementType() : Ty; | ||
} | ||
} | ||
|
||
#endif LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_VECUTILS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters