-
Notifications
You must be signed in to change notification settings - Fork 788
[SYCL][ESIMD]Limit propagation of ESIMD attributes #7191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5767c50
56854ed
38c1541
a0a9c53
dedf2ed
497aa64
a1aadf5
8f089a6
9d33f38
209532f
c6fed9f
992fcda
04737a2
cf0b167
9b59931
ac0422b
0ae282d
87d0f46
a073628
f1cad2f
53fd818
5a4eae3
70ae7a0
2618034
a7c301d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,32 +18,50 @@ namespace llvm { | |
namespace sycl { | ||
namespace utils { | ||
using CallGraphNodeAction = std::function<void(Function *)>; | ||
using CallGraphFunctionFilter = | ||
std::function<bool(const Instruction *, const Function *)>; | ||
|
||
// Traverses call graph starting from given function up the call chain applying | ||
// given action to each function met on the way. If \c ErrorOnNonCallUse | ||
// parameter is true, then no functions' uses are allowed except calls. | ||
// Otherwise, any function where use of the current one happened is added to the | ||
// call graph as if the use was a call. | ||
// The 'functionFilter' parameter is a callback function that can be used to | ||
// control which functions will be added to a call graph. | ||
// | ||
// The callback is invoked whenever a function being traversed is used | ||
// by some instruction which is not a call to this instruction (e.g. storing | ||
// function pointer to memory) - the first parameter is the using instructions, | ||
// the second - the function being traversed. The parent function of the | ||
// instruction is added to the call graph depending on whether the callback | ||
// returns 'true' (added) or 'false' (not added). | ||
// Functions which are part of the visited set ('Visited' parameter) are not | ||
// traversed. | ||
void traverseCallgraphUp(llvm::Function *F, CallGraphNodeAction NodeF, | ||
SmallPtrSetImpl<Function *> &Visited, | ||
bool ErrorOnNonCallUse); | ||
|
||
void traverseCallgraphUp( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a comment how functionFilter parameter is used. |
||
llvm::Function *F, CallGraphNodeAction NodeF, | ||
SmallPtrSetImpl<Function *> &Visited, bool ErrorOnNonCallUse, | ||
const CallGraphFunctionFilter &functionFilter = | ||
[](const Instruction *, const Function *) { return true; }); | ||
|
||
template <class CallGraphNodeActionF> | ||
void traverseCallgraphUp(Function *F, CallGraphNodeActionF ActionF, | ||
SmallPtrSetImpl<Function *> &Visited, | ||
bool ErrorOnNonCallUse) { | ||
void traverseCallgraphUp( | ||
Function *F, CallGraphNodeActionF ActionF, | ||
SmallPtrSetImpl<Function *> &Visited, bool ErrorOnNonCallUse, | ||
const CallGraphFunctionFilter &functionFilter = | ||
[](const Instruction *, const Function *) { return true; }) { | ||
traverseCallgraphUp(F, CallGraphNodeAction(ActionF), Visited, | ||
ErrorOnNonCallUse); | ||
ErrorOnNonCallUse, functionFilter); | ||
} | ||
|
||
template <class CallGraphNodeActionF> | ||
void traverseCallgraphUp(Function *F, CallGraphNodeActionF ActionF, | ||
bool ErrorOnNonCallUse = true) { | ||
void traverseCallgraphUp( | ||
Function *F, CallGraphNodeActionF ActionF, bool ErrorOnNonCallUse = true, | ||
const CallGraphFunctionFilter &functionFilter = | ||
[](const Instruction *, const Function *) { return true; }) { | ||
SmallPtrSet<Function *, 32> Visited; | ||
traverseCallgraphUp(F, CallGraphNodeAction(ActionF), Visited, | ||
ErrorOnNonCallUse); | ||
ErrorOnNonCallUse, functionFilter); | ||
} | ||
} // namespace utils | ||
} // namespace sycl | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,6 @@ using namespace llvm::esimd; | |
|
||
namespace { | ||
|
||
constexpr char ESIMD_MARKER_MD[] = "sycl_explicit_simd"; | ||
constexpr char REQD_SUB_GROUP_SIZE_MD[] = "intel_reqd_sub_group_size"; | ||
|
||
class SYCLLowerInvokeSimdLegacyPass : public ModulePass { | ||
|
@@ -73,10 +72,6 @@ ModulePass *llvm::createSYCLLowerInvokeSimdPass() { | |
|
||
namespace { | ||
// TODO support lambda and functor overloads | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to move this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO is unrelated to the removed code |
||
// This is the prefixes of the names generated from | ||
// sycl/ext/oneapi/experimental/invoke_simd.hpp::__builtin_invoke_simd | ||
// overloads instantiations: | ||
constexpr char INVOKE_SIMD_PREF[] = "_Z33__regcall3____builtin_invoke_simd"; | ||
|
||
using ValueSetImpl = SmallPtrSetImpl<Value *>; | ||
using ValueSet = SmallPtrSet<Value *, 4>; | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change (and other ones related to demangling) is no longer needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upon second thought, it is good to have the allocator defined in shared header, as others may need to use it too.