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) {
41764176 return true ;
41774177}
41784178
4179- NVPTXScopes::NVPTXScopes (LLVMContext &C) {
4179+ NVPTXScopes::NVPTXScopes (LLVMContext &C) : CTX(&C) {
41804180 Scopes[C.getOrInsertSyncScopeID (" singlethread" )] = NVPTX::Scope::Thread;
41814181 Scopes[C.getOrInsertSyncScopeID (" " )] = NVPTX::Scope::System;
41824182 Scopes[C.getOrInsertSyncScopeID (" block" )] = NVPTX::Scope::Block;
@@ -4190,13 +4190,11 @@ NVPTX::Scope NVPTXScopes::operator[](SyncScope::ID ID) const {
41904190 " NVPTXScopes::operator[]" );
41914191
41924192 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+
42004198 return S->second ;
42014199}
42024200
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ struct NVPTXScopes {
3535
3636private:
3737 SmallMapVector<SyncScope::ID, NVPTX::Scope, 8 > Scopes{};
38+ LLVMContext *CTX = nullptr ;
3839};
3940
4041class LLVM_LIBRARY_VISIBILITY NVPTXDAGToDAGISel : public SelectionDAGISel {
You can’t perform that action at this time.
0 commit comments