File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -4176,7 +4176,7 @@ bool NVPTXDAGToDAGISel::tryFence(SDNode *N) {
4176
4176
return true ;
4177
4177
}
4178
4178
4179
- NVPTXScopes::NVPTXScopes (LLVMContext &C) {
4179
+ NVPTXScopes::NVPTXScopes (LLVMContext &C) : CTX(&C) {
4180
4180
Scopes[C.getOrInsertSyncScopeID (" singlethread" )] = NVPTX::Scope::Thread;
4181
4181
Scopes[C.getOrInsertSyncScopeID (" " )] = NVPTX::Scope::System;
4182
4182
Scopes[C.getOrInsertSyncScopeID (" block" )] = NVPTX::Scope::Block;
@@ -4190,13 +4190,11 @@ NVPTX::Scope NVPTXScopes::operator[](SyncScope::ID ID) const {
4190
4190
" NVPTXScopes::operator[]" );
4191
4191
4192
4192
auto S = Scopes.find (ID);
4193
- if (S == Scopes.end ()) {
4194
- // TODO:
4195
- // - Add API to LLVMContext to get the name of a single scope.
4196
- // - Use that API here to print an error containing the name
4197
- // of this Unknown ID.
4198
- report_fatal_error (formatv (" Could not find scope ID={}." , int (ID)));
4199
- }
4193
+ if (S == Scopes.end ())
4194
+ report_fatal_error (
4195
+ formatv (" Could not find scope ID={} with name \" {}\" ." , int (ID),
4196
+ CTX->getSyncScopeName (ID).value_or (" unknown" )));
4197
+
4200
4198
return S->second ;
4201
4199
}
4202
4200
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ struct NVPTXScopes {
35
35
36
36
private:
37
37
SmallMapVector<SyncScope::ID, NVPTX::Scope, 8 > Scopes{};
38
+ LLVMContext *CTX = nullptr ;
38
39
};
39
40
40
41
class LLVM_LIBRARY_VISIBILITY NVPTXDAGToDAGISel : public SelectionDAGISel {
You can’t perform that action at this time.
0 commit comments