[OpenMP] NFC: Fix trivial typo

Differential Revision: https://reviews.llvm.org/D77430
diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt
index 7007611..6f0d9e7 100644
--- a/openmp/CMakeLists.txt
+++ b/openmp/CMakeLists.txt
@@ -91,5 +91,5 @@
   add_subdirectory(tools)
 endif()
 
-# Now that we have seen all testuites, create the check-openmp target.
+# Now that we have seen all testsuites, create the check-openmp target.
 construct_check_openmp_target()
diff --git a/openmp/libomptarget/deviceRTLs/common/debug.h b/openmp/libomptarget/deviceRTLs/common/debug.h
index d39ef9d..6539b7a 100644
--- a/openmp/libomptarget/deviceRTLs/common/debug.h
+++ b/openmp/libomptarget/deviceRTLs/common/debug.h
@@ -200,7 +200,7 @@
 
 #endif
 
-// for printing without worring about precision, pointers...
+// for printing without worrying about precision, pointers...
 #define P64(_x) ((unsigned long long)(_x))
 
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/openmp/libomptarget/deviceRTLs/common/omptarget.h b/openmp/libomptarget/deviceRTLs/common/omptarget.h
index 7985691..986eb36 100644
--- a/openmp/libomptarget/deviceRTLs/common/omptarget.h
+++ b/openmp/libomptarget/deviceRTLs/common/omptarget.h
@@ -206,8 +206,8 @@
   INLINE void InitTeamDescr();
 
   INLINE __kmpc_data_sharing_slot *RootS(int wid, bool IsMasterThread) {
-    // If this is invoked by the master thread of the master warp then intialize
-    // it with a smaller slot.
+    // If this is invoked by the master thread of the master warp then
+    // initialize it with a smaller slot.
     if (IsMasterThread) {
       // Do not initialize this slot again if it has already been initalized.
       if (master_rootS[0].DataEnd == &master_rootS[0].Data[0] + DS_Slot_Size)
diff --git a/openmp/libomptarget/deviceRTLs/common/omptargeti.h b/openmp/libomptarget/deviceRTLs/common/omptargeti.h
index 379a870..14faa59 100644
--- a/openmp/libomptarget/deviceRTLs/common/omptargeti.h
+++ b/openmp/libomptarget/deviceRTLs/common/omptargeti.h
@@ -42,7 +42,7 @@
 
   items.flags = 0;
   items.threadId = 0;         // is master
-  items.runtimeChunkSize = 1; // prefered chunking statik with chunk 1
+  items.runtimeChunkSize = 1; // preferred chunking statik with chunk 1
 }
 
 // This is called when all threads are started together in SPMD mode.
@@ -59,7 +59,7 @@
       TaskDescr_InPar | TaskDescr_IsParConstr; // set flag to parallel
   items.threadId =
       GetThreadIdInBlock(); // get ids from cuda (only called for 1st level)
-  items.runtimeChunkSize = 1; // prefered chunking statik with chunk 1
+  items.runtimeChunkSize = 1; // preferred chunking statik with chunk 1
   prev = parentTaskDescr;
 }
 
@@ -90,7 +90,7 @@
 INLINE void omptarget_nvptx_TaskDescr::CopyToWorkDescr(
     omptarget_nvptx_TaskDescr *masterTaskDescr) {
   CopyParent(masterTaskDescr);
-  // overrwrite specific items;
+  // overwrite specific items;
   items.flags |=
       TaskDescr_InPar | TaskDescr_IsParConstr; // set flag to parallel
 }
@@ -99,7 +99,7 @@
     omptarget_nvptx_TaskDescr *workTaskDescr) {
   Copy(workTaskDescr);
   //
-  // overrwrite specific items;
+  // overwrite specific items;
   //
   // The threadID should be GetThreadIdInBlock() % GetMasterThreadID().
   // This is so that the serial master (first lane in the master warp)
diff --git a/openmp/libomptarget/deviceRTLs/common/src/libcall.cu b/openmp/libomptarget/deviceRTLs/common/src/libcall.cu
index 11a888fd..89c481b 100644
--- a/openmp/libomptarget/deviceRTLs/common/src/libcall.cu
+++ b/openmp/libomptarget/deviceRTLs/common/src/libcall.cu
@@ -90,7 +90,7 @@
 EXTERN int omp_in_final(void) {
   // treat all tasks as final... Specs may expect runtime to keep
   // track more precisely if a task was actively set by users... This
-  // is not explicitely specified; will treat as if runtime can
+  // is not explicitly specified; will treat as if runtime can
   // actively decide to put a non-final task into a final one.
   int rc = 1;
   PRINT(LD_IO, "call omp_in_final() returns %d\n", rc);
diff --git a/openmp/libomptarget/deviceRTLs/common/src/loop.cu b/openmp/libomptarget/deviceRTLs/common/src/loop.cu
index 017af67..417460d 100644
--- a/openmp/libomptarget/deviceRTLs/common/src/loop.cu
+++ b/openmp/libomptarget/deviceRTLs/common/src/loop.cu
@@ -221,7 +221,7 @@
      * When it is we'll want to look at them somewhere here and use that
      * information to add to our schedule choice. We shouldn't need to pass
      * them on, they merely affect which schedule we can legally choose for
-     * various dynamic cases. (In paritcular, whether or not a stealing scheme
+     * various dynamic cases. (In particular, whether or not a stealing scheme
      * is legal).
      */
     schedule = SCHEDULE_WITHOUT_MODIFIERS(schedule);
diff --git a/openmp/libomptarget/deviceRTLs/common/src/sync.cu b/openmp/libomptarget/deviceRTLs/common/src/sync.cu
index 691e343..2ac3e3f 100644
--- a/openmp/libomptarget/deviceRTLs/common/src/sync.cu
+++ b/openmp/libomptarget/deviceRTLs/common/src/sync.cu
@@ -124,7 +124,7 @@
   PRINT0(LD_IO, "call kmpc_end_single\n");
   // decide to implement single with master: master get the single
   ASSERT0(LT_FUSSY, IsTeamMaster(global_tid), "expected only master here");
-  // sync barrier is explicitely called... so that is not a problem
+  // sync barrier is explicitly called... so that is not a problem
 }
 
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/openmp/libomptarget/deviceRTLs/interface.h b/openmp/libomptarget/deviceRTLs/interface.h
index 81e6718..3c216a5 100644
--- a/openmp/libomptarget/deviceRTLs/interface.h
+++ b/openmp/libomptarget/deviceRTLs/interface.h
@@ -98,7 +98,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 
 ////////////////////////////////////////////////////////////////////////////////
-// kmp specifc types
+// kmp specific types
 ////////////////////////////////////////////////////////////////////////////////
 
 typedef enum kmp_sched_t {
diff --git a/openmp/libomptarget/deviceRTLs/nvptx/docs/ReductionDesign.txt b/openmp/libomptarget/deviceRTLs/nvptx/docs/ReductionDesign.txt
index 989a01f..4149dfa 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/docs/ReductionDesign.txt
+++ b/openmp/libomptarget/deviceRTLs/nvptx/docs/ReductionDesign.txt
@@ -63,7 +63,7 @@
         b. its lane_id
         c. the offset of the lane_id which hosts a remote ReduceData
                 relative to the current one
-        d. an algorithm version paramter determining which reduction
+        d. an algorithm version parameter determining which reduction
                 algorithm to use.
         This shuffleReduceFn retrieves the remote ReduceData through shuffle
         intrinsics and  reduces, using the algorithm specified by the 4th
diff --git a/openmp/libomptarget/deviceRTLs/nvptx/test/parallel/level.c b/openmp/libomptarget/deviceRTLs/nvptx/test/parallel/level.c
index 2d88219..0a13753 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/test/parallel/level.c
+++ b/openmp/libomptarget/deviceRTLs/nvptx/test/parallel/level.c
@@ -70,7 +70,7 @@
         check4Inc += (omp_get_ancestor_thread_num(1) - id);
         // Expected to return the number of threads in the active parallel region.
         check4Inc += 3 * omp_get_team_size(1);
-        // Exptected to return 0 and 1.
+        // Expected to return 0 and 1.
         check4Inc += omp_get_ancestor_thread_num(2) + 3 * omp_get_team_size(2);
         // Expected to return -1, see above.
         check4Inc += omp_get_ancestor_thread_num(3) + omp_get_team_size(3);
diff --git a/openmp/libomptarget/src/interface.cpp b/openmp/libomptarget/src/interface.cpp
index 3df7c93..8ff9d8c 100644
--- a/openmp/libomptarget/src/interface.cpp
+++ b/openmp/libomptarget/src/interface.cpp
@@ -26,7 +26,7 @@
 std::mutex TargetOffloadMtx;
 
 ////////////////////////////////////////////////////////////////////////////////
-/// manage the success or failure of a target constuct
+/// manage the success or failure of a target construct
 
 static void HandleDefaultTargetOffload() {
   TargetOffloadMtx.lock();
diff --git a/openmp/runtime/cmake/LibompMicroTests.cmake b/openmp/runtime/cmake/LibompMicroTests.cmake
index d6e4db2..dc44e2c 100644
--- a/openmp/runtime/cmake/LibompMicroTests.cmake
+++ b/openmp/runtime/cmake/LibompMicroTests.cmake
@@ -25,7 +25,7 @@
 #  - Fails if stack is executable. Should only be readable and writable. Not executable.
 #  - Program dependencies: perl, readelf
 #  - Available for Unix dynamic library builds. Not available otherwise.
-# (4) test-instr (Intel(R) MIC Architecutre only)
+# (4) test-instr (Intel(R) MIC Architecture only)
 #  - Tests Intel(R) MIC Architecture libraries for valid instruction set
 #  - Fails if finds invalid instruction for Intel(R) MIC Architecture (wasn't compiled with correct flags)
 #  - Program dependencies: perl, objdump
diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
index 9f46b4b..1211441 100644
--- a/openmp/runtime/src/CMakeLists.txt
+++ b/openmp/runtime/src/CMakeLists.txt
@@ -183,7 +183,7 @@
   add_custom_target(libomp-needed-windows-files DEPENDS ${LIBOMP_LIB_NAME}.def)
   add_dependencies(omp libomp-needed-windows-files)
   # z_Windows_NT-586_asm.asm requires definitions to be sent via command line
-  # It only needs the architecutre macro and OMPT_SUPPORT=0|1
+  # It only needs the architecture macro and OMPT_SUPPORT=0|1
   libomp_append(LIBOMP_MASM_DEFINITIONS "-D_M_IA32" IF_TRUE IA32)
   libomp_append(LIBOMP_MASM_DEFINITIONS "-D_M_AMD64" IF_TRUE INTEL64)
   libomp_append(LIBOMP_MASM_DEFINITIONS "-DOMPT_SUPPORT" IF_TRUE_1_0 LIBOMP_OMPT_SUPPORT)
diff --git a/openmp/runtime/src/i18n/en_US.txt b/openmp/runtime/src/i18n/en_US.txt
index 3a3035b..b2ba63c0 100644
--- a/openmp/runtime/src/i18n/en_US.txt
+++ b/openmp/runtime/src/i18n/en_US.txt
@@ -324,7 +324,7 @@
 StgIgnored                   "%1$s: ignored because %2$s has been defined"
                                  # %1, -- name of ignored variable, %2 -- name of variable with higher priority.
 OBSOLETE                     "%1$s: overrides %3$s specified before"
-                                 # %1, %2 -- name and value of the overriding variable, %3 -- name of overriden variable.
+                                 # %1, %2 -- name and value of the overriding variable, %3 -- name of overridden variable.
 AffTilesNoHWLOC              "%1$s: Tiles are only supported if KMP_TOPOLOGY_METHOD=hwloc, using granularity=package instead"
 AffTilesNoTiles              "%1$s: Tiles requested but were not detected on this HW, using granularity=package instead"
 TopologyExtraTile            "%1$s: %2$d packages x %3$d tiles/pkg x %4$d cores/tile x %5$d threads/core (%6$d total cores)"
diff --git a/openmp/runtime/src/kmp.h b/openmp/runtime/src/kmp.h
index c912157..bfe708a 100644
--- a/openmp/runtime/src/kmp.h
+++ b/openmp/runtime/src/kmp.h
@@ -2435,10 +2435,10 @@
   int th_teams_level; /* save initial level of teams construct */
 /* it is 0 on device but may be any on host */
 
-/* The blocktime info is copied from the team struct to the thread sruct */
-/* at the start of a barrier, and the values stored in the team are used */
-/* at points in the code where the team struct is no longer guaranteed   */
-/* to exist (from the POV of worker threads).                            */
+/* The blocktime info is copied from the team struct to the thread struct */
+/* at the start of a barrier, and the values stored in the team are used  */
+/* at points in the code where the team struct is no longer guaranteed    */
+/* to exist (from the POV of worker threads).                             */
 #if KMP_USE_MONITOR
   int th_team_bt_intervals;
   int th_team_bt_set;
diff --git a/openmp/runtime/src/kmp_affinity.cpp b/openmp/runtime/src/kmp_affinity.cpp
index 650e9ff..9690df5 100644
--- a/openmp/runtime/src/kmp_affinity.cpp
+++ b/openmp/runtime/src/kmp_affinity.cpp
@@ -601,7 +601,7 @@
 
   int depth = 3;
   int levels[5] = {0, 1, 2, 3, 4}; // package, [node,] [tile,] core, thread
-  int labels[3] = {0}; // package [,node] [,tile] - head of lables array
+  int labels[3] = {0}; // package [,node] [,tile] - head of labels array
   if (__kmp_numa_detected)
     ++depth;
   if (__kmp_tile_depth)
@@ -828,7 +828,7 @@
   }
 
   int depth_full = depth; // number of levels before compressing
-  // Find any levels with radiix 1, and remove them from the map
+  // Find any levels with radix 1, and remove them from the map
   // (except for the package level).
   depth = __kmp_affinity_remove_radix_one_levels(retval, nActiveThreads, depth,
                                                  levels);
@@ -918,7 +918,7 @@
     return 0;
   }
 
-  // Contruct the data structure to be returned.
+  // Construct the data structure to be returned.
   *address2os =
       (AddrUnsPair *)__kmp_allocate(sizeof(**address2os) * __kmp_avail_proc);
   int avail_ct = 0;
@@ -967,7 +967,7 @@
     return -1;
   }
 
-  // Contruct the data structure to be returned.
+  // Construct the data structure to be returned.
   *address2os =
       (AddrUnsPair *)__kmp_allocate(sizeof(**address2os) * __kmp_avail_proc);
   KMP_DEBUG_ASSERT(__kmp_pu_os_idx == NULL);
@@ -1849,7 +1849,7 @@
     return 0;
   }
 
-  // Find any levels with radiix 1, and remove them from the map
+  // Find any levels with radix 1, and remove them from the map
   // (except for the package level).
   int new_depth = 0;
   for (level = 0; level < depth; level++) {
@@ -4328,7 +4328,7 @@
   }
 #endif // KMP_USE_HWLOC
 
-// If the user has specified that a paricular topology discovery method is to be
+// If the user has specified that a particular topology discovery method is to be
 // used, then we abort if that method fails. The exception is group affinity,
 // which might have been implicitly set.
 
@@ -4647,7 +4647,7 @@
 #undef KMP_EXIT_AFF_NONE
 
 void __kmp_affinity_initialize(void) {
-  // Much of the code above was written assumming that if a machine was not
+  // Much of the code above was written assuming that if a machine was not
   // affinity capable, then __kmp_affinity_type == affinity_none.  We now
   // explicitly represent this as __kmp_affinity_type == affinity_disabled.
   // There are too many checks for __kmp_affinity_type == affinity_none
@@ -4713,7 +4713,7 @@
     KMP_CPU_ZERO(th->th.th_affin_mask);
   }
 
-  // Copy the thread mask to the kmp_info_t strucuture. If
+  // Copy the thread mask to the kmp_info_t structure. If
   // __kmp_affinity_type == affinity_none, copy the "full" mask, i.e. one that
   // has all of the OS proc ids set, or if __kmp_affinity_respect_mask is set,
   // then the full mask is the same as the mask of the initialization thread.
@@ -4823,7 +4823,7 @@
                (th->th.th_new_place >= th->th.th_last_place));
   }
 
-  // Copy the thread mask to the kmp_info_t strucuture,
+  // Copy the thread mask to the kmp_info_t structure,
   // and set this thread's affinity.
   kmp_affin_mask_t *mask =
       KMP_CPU_INDEX(__kmp_affinity_masks, th->th.th_new_place);
diff --git a/openmp/runtime/src/kmp_alloc.cpp b/openmp/runtime/src/kmp_alloc.cpp
index 5138cd5..314f56d 100644
--- a/openmp/runtime/src/kmp_alloc.cpp
+++ b/openmp/runtime/src/kmp_alloc.cpp
@@ -186,7 +186,7 @@
                        -1: not all pool blocks are the same size
                        >0: (common) block size for all bpool calls made so far
                     */
-  bfhead_t *last_pool; /* Last pool owned by this thread (delay dealocation) */
+  bfhead_t *last_pool; /* Last pool owned by this thread (delay deallocation) */
 } thr_data_t;
 
 /*  Minimum allocation quantum: */
@@ -195,7 +195,7 @@
 #define MaxSize                                                                \
   (bufsize)(                                                                   \
       ~(((bufsize)(1) << (sizeof(bufsize) * CHAR_BIT - 1)) | (SizeQuant - 1)))
-// Maximun for the requested size.
+// Maximum for the requested size.
 
 /* End sentinel: value placed in bsize field of dummy block delimiting
    end of pool block.  The most negative number which will  fit  in  a
@@ -577,7 +577,7 @@
   if (thr->acqfcn != 0) {
     if (size > (bufsize)(thr->exp_incr - sizeof(bhead_t))) {
       /* Request is too large to fit in a single expansion block.
-         Try to satisy it by a direct buffer acquisition. */
+         Try to satisfy it by a direct buffer acquisition. */
       bdhead_t *bdh;
 
       size += sizeof(bdhead_t) - sizeof(bhead_t);
@@ -1961,7 +1961,7 @@
         this_thr->th.th_free_lists[index].th_free_list_other = ptr;
       } else {
         // either queue blocks owner is changing or size limit exceeded
-        // return old queue to allocating thread (q_th) synchroneously,
+        // return old queue to allocating thread (q_th) synchronously,
         // and start new list for alloc_thr's tasks
         void *old_ptr;
         void *tail = head;
diff --git a/openmp/runtime/src/kmp_csupport.cpp b/openmp/runtime/src/kmp_csupport.cpp
index ac9a935..579c4d5 100644
--- a/openmp/runtime/src/kmp_csupport.cpp
+++ b/openmp/runtime/src/kmp_csupport.cpp
@@ -92,7 +92,7 @@
 
 If multiple non-OpenMP threads all enter an OpenMP construct then this
 will be a unique thread identifier among all the threads created by
-the OpenMP runtime (but the value cannote be defined in terms of
+the OpenMP runtime (but the value cannot be defined in terms of
 OpenMP thread ids returned by omp_get_thread_num()).
 */
 kmp_int32 __kmpc_global_thread_num(ident_t *loc) {
diff --git a/openmp/runtime/src/kmp_dispatch.cpp b/openmp/runtime/src/kmp_dispatch.cpp
index a91ffa2..ba76575 100644
--- a/openmp/runtime/src/kmp_dispatch.cpp
+++ b/openmp/runtime/src/kmp_dispatch.cpp
@@ -1250,7 +1250,7 @@
             pr->u.p.parm4 = (victimIdx + 1) % nproc; // next victim
             continue; // not enough chunks to steal
           }
-          // stealing succeded, reduce victim's ub by 1/4 of undone chunks or
+          // stealing succeeded, reduce victim's ub by 1/4 of undone chunks or
           // by 1
           if (remaining > 3) {
             // steal 1/4 of remaining
@@ -1357,7 +1357,7 @@
                     (volatile kmp_int64 *)&victim->u.p.count,
                     *VOLATILE_CAST(kmp_int64 *) & vold.b,
                     *VOLATILE_CAST(kmp_int64 *) & vnew.b)) {
-              // stealing succedded
+              // stealing succeeded
               KMP_COUNT_DEVELOPER_VALUE(FOR_static_steal_stolen,
                                         vold.p.ub - vnew.p.ub);
               status = 1;
@@ -1372,7 +1372,7 @@
 #endif
               break;
             } // if (check CAS result)
-            KMP_CPU_PAUSE(); // CAS failed, repeate attempt
+            KMP_CPU_PAUSE(); // CAS failed, repeatedly attempt
           } // while (try to steal from particular victim)
         } // while (search for victim)
       } // if (try to find victim and steal)
@@ -1532,7 +1532,7 @@
       }
       if ((T)remaining <
           pr->u.p.parm2) { // compare with K*nproc*(chunk+1), K=2 by default
-        // use dynamic-style shcedule
+        // use dynamic-style schedule
         // atomically increment iterations, get old value
         init = test_then_add<ST>(RCAST(volatile ST *, &sh->u.s.iteration),
                                  (ST)chunkspec);
@@ -1601,7 +1601,7 @@
       KMP_DEBUG_ASSERT(init % chunk == 0);
       // compare with K*nproc*(chunk+1), K=2 by default
       if ((T)remaining < pr->u.p.parm2) {
-        // use dynamic-style shcedule
+        // use dynamic-style schedule
         // atomically increment iterations, get old value
         init = test_then_add<ST>(RCAST(volatile ST *, &sh->u.s.iteration),
                                  (ST)chunk);
@@ -1892,7 +1892,7 @@
   typedef typename traits_t<T>::unsigned_t UT;
   typedef typename traits_t<T>::signed_t ST;
   // This is potentially slightly misleading, schedule(runtime) will appear here
-  // even if the actual runtme schedule is static. (Which points out a
+  // even if the actual runtime schedule is static. (Which points out a
   // disadvantage of schedule(runtime): even when static scheduling is used it
   // costs more than a compile time choice to use static scheduling would.)
   KMP_TIME_PARTITIONED_BLOCK(OMP_loop_dynamic_scheduling);
@@ -1909,7 +1909,7 @@
        gtid, p_lb, p_ub, p_st, p_last));
 
   if (team->t.t_serialized) {
-    /* NOTE: serialize this dispatch becase we are not at the active level */
+    /* NOTE: serialize this dispatch because we are not at the active level */
     pr = reinterpret_cast<dispatch_private_info_template<T> *>(
         th->th.th_dispatch->th_disp_buffer); /* top of the stack */
     KMP_DEBUG_ASSERT(pr);
diff --git a/openmp/runtime/src/kmp_dispatch_hier.h b/openmp/runtime/src/kmp_dispatch_hier.h
index 3d7faea..c615b7b 100644
--- a/openmp/runtime/src/kmp_dispatch_hier.h
+++ b/openmp/runtime/src/kmp_dispatch_hier.h
@@ -993,7 +993,7 @@
     th->th.th_hier_bar_data = (kmp_hier_private_bdata_t *)__kmp_allocate(
         sizeof(kmp_hier_private_bdata_t) * kmp_hier_layer_e::LAYER_LAST);
   }
-  // Have threads "register" themselves by modifiying the active count for each
+  // Have threads "register" themselves by modifying the active count for each
   // level they are involved in. The active count will act as nthreads for that
   // level regarding the scheduling algorithms
   for (int i = 0; i < n; ++i) {
diff --git a/openmp/runtime/src/kmp_environment.h b/openmp/runtime/src/kmp_environment.h
index 76a9672..a7ea9e9 100644
--- a/openmp/runtime/src/kmp_environment.h
+++ b/openmp/runtime/src/kmp_environment.h
@@ -1,5 +1,5 @@
 /*
- * kmp_environment.h -- Handle environment varoiables OS-independently.
+ * kmp_environment.h -- Handle environment variables OS-independently.
  */
 
 //===----------------------------------------------------------------------===//
diff --git a/openmp/runtime/src/kmp_gsupport.cpp b/openmp/runtime/src/kmp_gsupport.cpp
index e0739a7..d7592f3 100644
--- a/openmp/runtime/src/kmp_gsupport.cpp
+++ b/openmp/runtime/src/kmp_gsupport.cpp
@@ -275,7 +275,7 @@
 #define KMP_DISPATCH_FINI_CHUNK_ULL __kmp_aux_dispatch_fini_chunk_8u
 #define KMP_DISPATCH_NEXT_ULL __kmpc_dispatch_next_8u
 
-// The parallel contruct
+// The parallel construct
 
 #ifndef KMP_DEBUG
 static
@@ -325,7 +325,7 @@
                                           enum sched_type schedule, long start,
                                           long end, long incr,
                                           long chunk_size) {
-  // Intialize the loop worksharing construct.
+  // Initialize the loop worksharing construct.
 
   KMP_DISPATCH_INIT(loc, *gtid, schedule, start, end, incr, chunk_size,
                     schedule != kmp_sch_static);
diff --git a/openmp/runtime/src/kmp_i18n.cpp b/openmp/runtime/src/kmp_i18n.cpp
index 53c4427..d2651cf 100644
--- a/openmp/runtime/src/kmp_i18n.cpp
+++ b/openmp/runtime/src/kmp_i18n.cpp
@@ -639,7 +639,7 @@
   // numbers, for example:  "%2$s %1$s".
   __kmp_str_buf_vprint(&buffer, __kmp_i18n_catgets(id), args);
 #elif KMP_OS_WINDOWS
-  // On Winodws, printf() family functions does not recognize GNU style
+  // On Windows, printf() family functions does not recognize GNU style
   // parameter numbers, so we have to use FormatMessage() instead. It recognizes
   // parameter numbers, e. g.:  "%2!s! "%1!s!".
   {
diff --git a/openmp/runtime/src/kmp_i18n.h b/openmp/runtime/src/kmp_i18n.h
index 9d79a21..3fd6099 100644
--- a/openmp/runtime/src/kmp_i18n.h
+++ b/openmp/runtime/src/kmp_i18n.h
@@ -32,7 +32,7 @@
 
    __kmp_i18n_catgets() returns read-only string. It should not be freed.
 
-   KMP_I18N_STR macro simplifies acces to strings in message catalog a bit.
+   KMP_I18N_STR macro simplifies access to strings in message catalog a bit.
    Following two lines are equivalent:
 
    __kmp_i18n_catgets( kmp_i18n_str_Warning )
diff --git a/openmp/runtime/src/kmp_lock.cpp b/openmp/runtime/src/kmp_lock.cpp
index 8e20c6c..8bf7ef2 100644
--- a/openmp/runtime/src/kmp_lock.cpp
+++ b/openmp/runtime/src/kmp_lock.cpp
@@ -3021,7 +3021,7 @@
 static kmp_indirect_lock_t *__kmp_indirect_lock_pool[KMP_NUM_I_LOCKS] = {0};
 
 // User lock allocator for dynamically dispatched indirect locks. Every entry of
-// the indirect lock table holds the address and type of the allocated indrect
+// the indirect lock table holds the address and type of the allocated indirect
 // lock (kmp_indirect_lock_t), and the size of the table doubles when it is
 // full. A destroyed indirect lock object is returned to the reusable pool of
 // locks, unique to each lock type.
diff --git a/openmp/runtime/src/kmp_lock.h b/openmp/runtime/src/kmp_lock.h
index 75a15f0..e54f681 100644
--- a/openmp/runtime/src/kmp_lock.h
+++ b/openmp/runtime/src/kmp_lock.h
@@ -42,7 +42,7 @@
 // ----------------------------------------------------------------------------
 
 // We need to know the size of the area we can assume that the compiler(s)
-// allocated for obects of type omp_lock_t and omp_nest_lock_t.  The Intel
+// allocated for objects of type omp_lock_t and omp_nest_lock_t.  The Intel
 // compiler always allocates a pointer-sized area, as does visual studio.
 //
 // gcc however, only allocates 4 bytes for regular locks, even on 64-bit
@@ -861,11 +861,11 @@
 //
 // In other cases, the calling code really should differentiate between an
 // unimplemented function and one that is implemented but returning NULL /
-// invalied value.  If this is the case, no get function wrapper exists.
+// invalid value.  If this is the case, no get function wrapper exists.
 
 extern int (*__kmp_is_user_lock_initialized_)(kmp_user_lock_p lck);
 
-// no set function; fields set durining local allocation
+// no set function; fields set during local allocation
 
 extern const ident_t *(*__kmp_get_user_lock_location_)(kmp_user_lock_p lck);
 
@@ -899,7 +899,7 @@
   }
 }
 
-// The fuction which sets up all of the vtbl pointers for kmp_user_lock_t.
+// The function which sets up all of the vtbl pointers for kmp_user_lock_t.
 extern void __kmp_set_user_lock_vptrs(kmp_lock_kind_t user_lock_kind);
 
 // Macros for binding user lock functions.
@@ -1128,7 +1128,7 @@
 extern int (**__kmp_direct_test)(kmp_dyna_lock_t *, kmp_int32);
 
 // Function tables for indirect locks. Set/unset/test differentiate functions
-// with/withuot consistency checking.
+// with/without consistency checking.
 extern void (*__kmp_indirect_init[])(kmp_user_lock_p);
 extern void (**__kmp_indirect_destroy)(kmp_user_lock_p);
 extern int (**__kmp_indirect_set)(kmp_user_lock_p, kmp_int32);
diff --git a/openmp/runtime/src/kmp_omp.h b/openmp/runtime/src/kmp_omp.h
index 27b550d..c7ba32a 100644
--- a/openmp/runtime/src/kmp_omp.h
+++ b/openmp/runtime/src/kmp_omp.h
@@ -47,7 +47,7 @@
 } kmp_omp_nthr_item_t;
 
 typedef struct {
-  kmp_int32 num; // Number of items in the arrray.
+  kmp_int32 num; // Number of items in the array.
   kmp_uint64 array; // Address of array of kmp_omp_num_threads_item_t.
 } kmp_omp_nthr_info_t;
 
diff --git a/openmp/runtime/src/kmp_runtime.cpp b/openmp/runtime/src/kmp_runtime.cpp
index 4df3fef..e0c8cf2 100644
--- a/openmp/runtime/src/kmp_runtime.cpp
+++ b/openmp/runtime/src/kmp_runtime.cpp
@@ -3529,7 +3529,7 @@
   // > __kmp_max_nth in one of two ways:
   //
   // 1) The initialization thread (gtid = 0) exits.  __kmp_threads[0]
-  //    may not be resused by another thread, so we may need to increase
+  //    may not be reused by another thread, so we may need to increase
   //    __kmp_threads_capacity to __kmp_max_nth + 1.
   //
   // 2) New foreign root(s) are encountered.  We always register new foreign
@@ -4515,11 +4515,11 @@
 #if KMP_AFFINITY_SUPPORTED
 
 // __kmp_partition_places() is the heart of the OpenMP 4.0 affinity mechanism.
-// It calculats the worker + master thread's partition based upon the parent
+// It calculates the worker + master thread's partition based upon the parent
 // thread's partition, and binds each worker to a thread in their partition.
 // The master thread's partition should already include its current binding.
 static void __kmp_partition_places(kmp_team_t *team, int update_master_only) {
-  // Copy the master thread's place partion to the team struct
+  // Copy the master thread's place partition to the team struct
   kmp_info_t *master_th = team->t.t_threads[0];
   KMP_DEBUG_ASSERT(master_th != NULL);
   kmp_proc_bind_t proc_bind = team->t.t_proc_bind;
@@ -5536,7 +5536,7 @@
 // locality problems on programs where the size of the hot team regularly
 // grew and shrunk.
 //
-// Now, for single-level parallelism, the OMP tid is alway == gtid.
+// Now, for single-level parallelism, the OMP tid is always == gtid.
 void __kmp_free_thread(kmp_info_t *this_th) {
   int gtid;
   kmp_info_t **scan;
@@ -5609,7 +5609,7 @@
   // scan is the address of a link in the list, possibly the address of
   // __kmp_thread_pool itself.
   //
-  // In the absence of nested parallism, the for loop will have 0 iterations.
+  // In the absence of nested parallelism, the for loop will have 0 iterations.
   if (__kmp_thread_pool_insert_pt != NULL) {
     scan = &(__kmp_thread_pool_insert_pt->th.th_next_pool);
   } else {
@@ -6088,7 +6088,7 @@
      only place to clear __kmp_serial_init */
   /* we'll check this later too, after we get the lock */
   // 2009-09-06: We do not set g_abort without setting g_done. This check looks
-  // redundaant, because the next check will work in any case.
+  // redundant, because the next check will work in any case.
   if (__kmp_global.g.g_abort) {
     KA_TRACE(11, ("__kmp_internal_end_library: abort, exiting\n"));
     /* TODO abort? */
diff --git a/openmp/runtime/src/kmp_sched.cpp b/openmp/runtime/src/kmp_sched.cpp
index 17c1498..28d0ffe 100644
--- a/openmp/runtime/src/kmp_sched.cpp
+++ b/openmp/runtime/src/kmp_sched.cpp
@@ -667,7 +667,7 @@
   // stride for next chunks calculation.
   // Last iteration flag set for the team that will execute
   // the last iteration of the loop.
-  // The routine is called for dist_schedue(static,chunk) only.
+  // The routine is called for dist_schedule(static,chunk) only.
   typedef typename traits_t<T>::unsigned_t UT;
   typedef typename traits_t<T>::signed_t ST;
   kmp_uint32 team_id;
diff --git a/openmp/runtime/src/kmp_settings.cpp b/openmp/runtime/src/kmp_settings.cpp
index f76e310..5745cbb 100644
--- a/openmp/runtime/src/kmp_settings.cpp
+++ b/openmp/runtime/src/kmp_settings.cpp
@@ -364,7 +364,7 @@
     char const
         *name, // I: Name of environment variable (used in warning messages).
     char const *value, // I: Value of environment variable to parse.
-    int min, // I: Miminal allowed value.
+    int min, // I: Minimum allowed value.
     int max, // I: Maximum allowed value.
     int *out // O: Output (parsed) value.
     ) {
@@ -1305,7 +1305,7 @@
 } // __kmp_stg_print_max_task_priority
 
 // KMP_TASKLOOP_MIN_TASKS
-// taskloop threashold to switch from recursive to linear tasks creation
+// taskloop threshold to switch from recursive to linear tasks creation
 static void __kmp_stg_parse_taskloop_min_tasks(char const *name,
                                                char const *value, void *data) {
   int tmp;
@@ -2041,7 +2041,7 @@
 // If we see a parse error, emit a warning and scan to the next ",".
 //
 // FIXME - there's got to be a better way to print an error
-// message, hopefully without overwritting peices of buf.
+// message, hopefully without overwriting peices of buf.
 #define EMIT_WARN(skip, errlist)                                               \
   {                                                                            \
     char ch;                                                                   \
@@ -4395,7 +4395,7 @@
 // -----------------------------------------------------------------------------
 // KMP_HW_SUBSET (was KMP_PLACE_THREADS)
 
-// The longest observable sequense of items is
+// The longest observable sequence of items is
 // Socket-Node-Tile-Core-Thread
 // So, let's limit to 5 levels for now
 // The input string is usually short enough, let's use 512 limit for now
diff --git a/openmp/runtime/src/kmp_stats.cpp b/openmp/runtime/src/kmp_stats.cpp
index dabd0c3..55ac18a 100644
--- a/openmp/runtime/src/kmp_stats.cpp
+++ b/openmp/runtime/src/kmp_stats.cpp
@@ -270,7 +270,7 @@
 /* ************* partitionedTimers member functions ************* */
 partitionedTimers::partitionedTimers() { timer_stack.reserve(8); }
 
-// initialize the paritioned timers to an initial timer
+// initialize the partitioned timers to an initial timer
 void partitionedTimers::init(explicitTimer timer) {
   KMP_DEBUG_ASSERT(this->timer_stack.size() == 0);
   timer_stack.push_back(timer);
@@ -609,7 +609,7 @@
               totalStats[s].format(tag, true).c_str());
   }
 
-  // Print historgram of statistics
+  // Print histogram of statistics
   if (theStats[0].haveHist()) {
     fprintf(statsOut, "\nTimer distributions\n");
     for (int s = 0; s < TIMER_LAST; s++) {
diff --git a/openmp/runtime/src/kmp_stats.h b/openmp/runtime/src/kmp_stats.h
index ee95658..a36528f 100644
--- a/openmp/runtime/src/kmp_stats.h
+++ b/openmp/runtime/src/kmp_stats.h
@@ -195,7 +195,7 @@
 //                                from a dynamically scheduled loop
 // OMP_critical           -- Time thread spends executing critical section
 // OMP_critical_wait      -- Time thread spends waiting to enter
-//                           a critcal seciton
+//                           a critical section
 // OMP_single             -- Time spent executing a "single" region
 // OMP_master             -- Time spent executing a "master" region
 // OMP_task_immediate     -- Time spent executing non-deferred tasks
@@ -522,7 +522,7 @@
   void windup();
 };
 
-// Special wrapper around the partioned timers to aid timing code blocks
+// Special wrapper around the partitioned timers to aid timing code blocks
 // It avoids the need to have an explicit end, leaving the scope suffices.
 class blockPartitionedTimer {
   partitionedTimers *part_timers;
@@ -920,7 +920,7 @@
 #define KMP_OUTPUT_STATS(heading_string) __kmp_output_stats(heading_string)
 
 /*!
- * \brief Initializes the paritioned timers to begin with name.
+ * \brief Initializes the partitioned timers to begin with name.
  *
  * @param name timer which you want this thread to begin with
  *
diff --git a/openmp/runtime/src/kmp_str.h b/openmp/runtime/src/kmp_str.h
index 09faadb..9e669bb 100644
--- a/openmp/runtime/src/kmp_str.h
+++ b/openmp/runtime/src/kmp_str.h
@@ -72,12 +72,12 @@
 typedef struct kmp_str_fname kmp_str_fname_t;
 void __kmp_str_fname_init(kmp_str_fname_t *fname, char const *path);
 void __kmp_str_fname_free(kmp_str_fname_t *fname);
-// Compares file name with specified patern. If pattern is NULL, any fname
+// Compares file name with specified pattern. If pattern is NULL, any fname
 // matched.
 int __kmp_str_fname_match(kmp_str_fname_t const *fname, char const *pattern);
 
 /* The compiler provides source locations in string form
-   ";file;func;line;col;;". It is not convenient for manupulation. This
+   ";file;func;line;col;;". It is not convenient for manipulation. This
    structure keeps source location in more convenient form.
    Usage:
 
diff --git a/openmp/runtime/src/kmp_stub.cpp b/openmp/runtime/src/kmp_stub.cpp
index 6b50419..0fc022a 100644
--- a/openmp/runtime/src/kmp_stub.cpp
+++ b/openmp/runtime/src/kmp_stub.cpp
@@ -147,7 +147,7 @@
   i;
   void *res;
 #if KMP_OS_WINDOWS
-  // If succesfull returns a pointer to the memory block, otherwise returns
+  // If successful returns a pointer to the memory block, otherwise returns
   // NULL.
   // Sets errno to ENOMEM or EINVAL if memory allocation failed or parameter
   // validation failed.
diff --git a/openmp/runtime/src/kmp_taskdeps.cpp b/openmp/runtime/src/kmp_taskdeps.cpp
index e1618f5..7db7da5 100644
--- a/openmp/runtime/src/kmp_taskdeps.cpp
+++ b/openmp/runtime/src/kmp_taskdeps.cpp
@@ -35,7 +35,7 @@
 
 static void __kmp_init_node(kmp_depnode_t *node) {
   node->dn.successors = NULL;
-  node->dn.task = NULL; // will point to the rigth task
+  node->dn.task = NULL; // will point to the right task
   // once dependences have been processed
   for (int i = 0; i < MAX_MTX_DEPS; ++i)
     node->dn.mtx_locks[i] = NULL;
@@ -473,8 +473,8 @@
   npredecessors++;
 
   // Update predecessors and obtain current value to check if there are still
-  // any outstandig dependences (some tasks may have finished while we processed
-  // the dependences)
+  // any outstanding dependences (some tasks may have finished while we
+  // processed the dependences)
   npredecessors =
       node->dn.npredecessors.fetch_add(npredecessors) + npredecessors;
 
@@ -498,7 +498,7 @@
 @param noalias_dep_list List of depend items with no aliasing
 
 @return Returns either TASK_CURRENT_NOT_QUEUED if the current task was not
-suspendend and queued, or TASK_CURRENT_QUEUED if it was suspended and queued
+suspended and queued, or TASK_CURRENT_QUEUED if it was suspended and queued
 
 Schedule a non-thread-switchable task with dependences for execution
 */
diff --git a/openmp/runtime/src/kmp_tasking.cpp b/openmp/runtime/src/kmp_tasking.cpp
index 6dae9dc..1cfc66f 100644
--- a/openmp/runtime/src/kmp_tasking.cpp
+++ b/openmp/runtime/src/kmp_tasking.cpp
@@ -912,7 +912,7 @@
   /* If the tasks' destructor thunk flag has been set, we need to invoke the
      destructor thunk that has been generated by the compiler. The code is
      placed here, since at this point other tasks might have been released
-     hence overlapping the destructor invokations with some other work in the
+     hence overlapping the destructor invocations with some other work in the
      released tasks.  The OpenMP spec is not specific on when the destructors
      are invoked, so we should be free to choose. */
   if (taskdata->td_flags.destructors_thunk) {
@@ -1411,7 +1411,7 @@
 //
 // gtid: global thread ID of caller
 // task: the task to invoke
-// current_task: the task to resume after task invokation
+// current_task: the task to resume after task invocation
 static void __kmp_invoke_task(kmp_int32 gtid, kmp_task_t *task,
                               kmp_taskdata_t *current_task) {
   kmp_taskdata_t *taskdata = KMP_TASK_TO_TASKDATA(task);
@@ -2911,7 +2911,7 @@
       // met, then return now, so that the barrier gather/release pattern can
       // proceed. If this thread is in the last spin loop in the barrier,
       // waiting to be released, we know that the termination condition will not
-      // be satisified, so don't waste any cycles checking it.
+      // be satisfied, so don't waste any cycles checking it.
       if (flag == NULL || (!final_spin && flag->done_check())) {
         KA_TRACE(
             15,
@@ -3096,7 +3096,7 @@
  * to each thread in the team, so that it can steal work from it.
  *
  * Enter the existence of the kmp_task_team_t struct.  It employs a reference
- * counting mechanims, and is allocated by the master thread before calling
+ * counting mechanism, and is allocated by the master thread before calling
  * __kmp_<barrier_kind>_release, and then is release by the last thread to
  * exit __kmp_<barrier_kind>_release at the next barrier.  I.e. the lifetimes
  * of the kmp_task_team_t structs for consecutive barriers can overlap
@@ -3107,7 +3107,7 @@
  * We currently use the existence of the threads array as an indicator that
  * tasks were spawned since the last barrier.  If the structure is to be
  * useful outside the context of tasking, then this will have to change, but
- * not settting the field minimizes the performance impact of tasking on
+ * not setting the field minimizes the performance impact of tasking on
  * barriers, when no explicit tasks were spawned (pushed, actually).
  */
 
@@ -4258,7 +4258,7 @@
 // grainsize  Number of loop iterations per task
 // extras     Number of chunks with grainsize+1 iterations
 // tc         Iterations count
-// num_t_min  Threashold to launch tasks recursively
+// num_t_min  Threshold to launch tasks recursively
 // task_dup   Tasks duplication routine
 // codeptr_ra Return address for OMPT events
 void __kmp_taskloop_recur(ident_t *loc, int gtid, kmp_task_t *task,
diff --git a/openmp/runtime/src/kmp_utility.cpp b/openmp/runtime/src/kmp_utility.cpp
index 44a99d0..6e6785d 100644
--- a/openmp/runtime/src/kmp_utility.cpp
+++ b/openmp/runtime/src/kmp_utility.cpp
@@ -194,7 +194,7 @@
       KA_TRACE(trace_level, (" PSN"));
     }
     if ((buf.edx >> 19) & 1) {
-      /* CLFULSH - Cache Flush Instruction Available */
+      /* CLFLUSH - Cache Flush Instruction Available */
       cflush_size =
           data[1] * 8; /* Bits 15-08: CLFLUSH line size = 8 (64 bytes) */
       KA_TRACE(trace_level, (" CLFLUSH(%db)", cflush_size));
diff --git a/openmp/runtime/src/kmp_wrapper_malloc.h b/openmp/runtime/src/kmp_wrapper_malloc.h
index 1544c5d..c027e0b 100644
--- a/openmp/runtime/src/kmp_wrapper_malloc.h
+++ b/openmp/runtime/src/kmp_wrapper_malloc.h
@@ -15,11 +15,11 @@
 #define KMP_WRAPPER_MALLOC_H
 
 /* This header serves for 3 purposes:
-   1. Declaring standard memory allocation rourines in OS-independent way.
+   1. Declaring standard memory allocation routines in OS-independent way.
    2. Passing source location info through memory allocation wrappers.
    3. Enabling native memory debugging capabilities.
 
-   1. Declaring standard memory allocation rourines in OS-independent way.
+   1. Declaring standard memory allocation routines in OS-independent way.
    -----------------------------------------------------------------------
    On Linux* OS, alloca() function is declared in <alloca.h> header, while on
    Windows* OS there is no <alloca.h> header, function _alloca() (note
@@ -103,9 +103,9 @@
 #error Unknown or unsupported OS.
 #endif
 
-/* KMP_SRC_LOC_DECL -- Declaring source location paramemters, to be used in
+/* KMP_SRC_LOC_DECL -- Declaring source location parameters, to be used in
    function declaration.
-   KMP_SRC_LOC_PARM -- Source location paramemters, to be used to pass
+   KMP_SRC_LOC_PARM -- Source location parameters, to be used to pass
    parameters to underlying levels.
    KMP_SRC_LOC_CURR -- Source location arguments describing current location,
    to be used at top-level.
diff --git a/openmp/runtime/src/ompt-specific.h b/openmp/runtime/src/ompt-specific.h
index 5ba240c..fa5c566 100644
--- a/openmp/runtime/src/ompt-specific.h
+++ b/openmp/runtime/src/ompt-specific.h
@@ -102,7 +102,7 @@
 inline const char *ompt_get_runtime_version() {
   return &__kmp_version_lib_ver[KMP_VERSION_MAGIC_LEN];
 }
-#endif // OMPT_SUPPRORT
+#endif // OMPT_SUPPORT
 
 // macros providing the OMPT callbacks for reduction clause
 #if OMPT_SUPPORT && OMPT_OPTIONAL
diff --git a/openmp/runtime/src/thirdparty/ittnotify/ittnotify.h b/openmp/runtime/src/thirdparty/ittnotify/ittnotify.h
index d730c48..db1c0d0 100644
--- a/openmp/runtime/src/thirdparty/ittnotify/ittnotify.h
+++ b/openmp/runtime/src/thirdparty/ittnotify/ittnotify.h
@@ -2303,7 +2303,7 @@
  * name of the metadata), and a value (the actual data). The encoding of
  * the value depends on the type of the metadata.
  *
- * The type of metadata is specified by an enumerated type __itt_metdata_type.
+ * The type of metadata is specified by an enumerated type __itt_metadata_type.
  * @{
  */
 
@@ -3196,7 +3196,7 @@
 #define __itt_relation_add_ex(d,x,y,z,a,b)          ITTNOTIFY_VOID_D5(relation_add_ex,d,x,y,z,a,b)
 #define __itt_relation_add_ex_ptr                   ITTNOTIFY_NAME(relation_add_ex)
 #else  /* INTEL_NO_ITTNOTIFY_API */
-#define __itt_relation_add_to_current_ex(domain,clock_domain,timestame,relation,tail)
+#define __itt_relation_add_to_current_ex(domain,clock_domain,timestamp,relation,tail)
 #define __itt_relation_add_to_current_ex_ptr 0
 #define __itt_relation_add_ex(domain,clock_domain,timestamp,head,relation,tail)
 #define __itt_relation_add_ex_ptr 0
diff --git a/openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.cpp b/openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.cpp
index 8f9e2a6..4936b9b 100644
--- a/openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.cpp
+++ b/openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.cpp
@@ -762,7 +762,7 @@
 
 /* This function return value of env variable that placed into static buffer.
  * !!! The same static buffer is used for subsequent calls. !!!
- * This was done to aviod dynamic allocation for few calls.
+ * This was done to avoid dynamic allocation for few calls.
  * Actually we need this function only four times.
  */
 static const char* __itt_get_env_var(const char* name)
@@ -1012,7 +1012,7 @@
 static void __itt_nullify_all_pointers(void)
 {
     int i;
-    /* Nulify all pointers except domain_create, string_handle_create  and counter_create */
+    /* Nullify all pointers except domain_create, string_handle_create  and counter_create */
     for (i = 0; _N_(_ittapi_global).api_list_ptr[i].name != NULL; i++)
         *_N_(_ittapi_global).api_list_ptr[i].func_ptr = _N_(_ittapi_global).api_list_ptr[i].null_func;
 }
diff --git a/openmp/runtime/src/z_Linux_util.cpp b/openmp/runtime/src/z_Linux_util.cpp
index 5e2d1bd..3b5910f 100644
--- a/openmp/runtime/src/z_Linux_util.cpp
+++ b/openmp/runtime/src/z_Linux_util.cpp
@@ -2207,7 +2207,7 @@
 
 #else // Linux* OS
 
-// The fuction returns number of running (not sleeping) threads, or -1 in case
+// The function returns number of running (not sleeping) threads, or -1 in case
 // of error. Error could be reported if Linux* OS kernel too old (without
 // "/proc" support). Counting running threads stops if max running threads
 // encountered.
diff --git a/openmp/runtime/test/lock/omp_init_lock.c b/openmp/runtime/test/lock/omp_init_lock.c
index 24b60d1..49fd633 100644
--- a/openmp/runtime/test/lock/omp_init_lock.c
+++ b/openmp/runtime/test/lock/omp_init_lock.c
@@ -23,7 +23,7 @@
       omp_unset_lock(&my_lcks[j % LOCKS_PER_ITER]);
     }
   }
-  // Wait until all repititions are done.  The test is exercising growth of
+  // Wait until all repetitions are done.  The test is exercising growth of
   // the global lock pool, which does not shrink when no locks are allocated.
   {
     int j;
diff --git a/openmp/runtime/test/ompt/synchronization/barrier/implicit_task_data.c b/openmp/runtime/test/ompt/synchronization/barrier/implicit_task_data.c
index 71c2b15..3eb14d5 100644
--- a/openmp/runtime/test/ompt/synchronization/barrier/implicit_task_data.c
+++ b/openmp/runtime/test/ompt/synchronization/barrier/implicit_task_data.c
@@ -3,7 +3,7 @@
 
 // This test checks that values stored in task_data in a barrier_begin event
 // are still present in the corresponding barrier_end event.
-// Therefore, callback implementations different from the ones in callback.h are neccessary.
+// Therefore, callback implementations different from the ones in callback.h are necessary.
 // This is a test for an issue reported in 
 // https://github.com/OpenMPToolsInterface/LLVM-openmp/issues/39
 
diff --git a/openmp/runtime/test/tasking/kmp_task_modifier_simple_par_new.cpp b/openmp/runtime/test/tasking/kmp_task_modifier_simple_par_new.cpp
index f2dea9d..9812d60 100644
--- a/openmp/runtime/test/tasking/kmp_task_modifier_simple_par_new.cpp
+++ b/openmp/runtime/test/tasking/kmp_task_modifier_simple_par_new.cpp
@@ -39,7 +39,7 @@
   void *reduce_orig; /**< original reduction item used for initialization */
   size_t reduce_size; /**< size of data item in bytes */
   // three compiler-generated routines (init, fini are optional):
-  void *reduce_init; /**< data initialization routine (single paramemter) */
+  void *reduce_init; /**< data initialization routine (single parameter) */
   void *reduce_fini; /**< data finalization routine */
   void *reduce_comb; /**< data combiner routine */
   unsigned flags; /**< flags for additional info from compiler */
diff --git a/openmp/runtime/test/tasking/kmp_task_modifier_simple_par_old.cpp b/openmp/runtime/test/tasking/kmp_task_modifier_simple_par_old.cpp
index 2526d4e..94e9bbc 100644
--- a/openmp/runtime/test/tasking/kmp_task_modifier_simple_par_old.cpp
+++ b/openmp/runtime/test/tasking/kmp_task_modifier_simple_par_old.cpp
@@ -36,7 +36,7 @@
   void *reduce_shar; /**< shared between tasks item to reduce into */
   size_t reduce_size; /**< size of data item in bytes */
   // three compiler-generated routines (init, fini are optional):
-  void *reduce_init; /**< data initialization routine (single paramemter) */
+  void *reduce_init; /**< data initialization routine (single parameter) */
   void *reduce_fini; /**< data finalization routine */
   void *reduce_comb; /**< data combiner routine */
   unsigned flags; /**< flags for additional info from compiler */
diff --git a/openmp/runtime/test/tasking/kmp_task_modifier_simple_ws_new.cpp b/openmp/runtime/test/tasking/kmp_task_modifier_simple_ws_new.cpp
index e66cda9..29d86e3 100644
--- a/openmp/runtime/test/tasking/kmp_task_modifier_simple_ws_new.cpp
+++ b/openmp/runtime/test/tasking/kmp_task_modifier_simple_ws_new.cpp
@@ -39,7 +39,7 @@
   void *reduce_orig; /**< original reduction item used for initialization */
   size_t reduce_size; /**< size of data item in bytes */
   // three compiler-generated routines (init, fini are optional):
-  void *reduce_init; /**< data initialization routine (single paramemter) */
+  void *reduce_init; /**< data initialization routine (single parameter) */
   void *reduce_fini; /**< data finalization routine */
   void *reduce_comb; /**< data combiner routine */
   unsigned flags; /**< flags for additional info from compiler */
diff --git a/openmp/runtime/test/tasking/kmp_task_modifier_simple_ws_old.cpp b/openmp/runtime/test/tasking/kmp_task_modifier_simple_ws_old.cpp
index 97d5cb5..3e0ce26 100644
--- a/openmp/runtime/test/tasking/kmp_task_modifier_simple_ws_old.cpp
+++ b/openmp/runtime/test/tasking/kmp_task_modifier_simple_ws_old.cpp
@@ -36,7 +36,7 @@
   void *reduce_shar; /**< shared between tasks item to reduce into */
   size_t reduce_size; /**< size of data item in bytes */
   // three compiler-generated routines (init, fini are optional):
-  void *reduce_init; /**< data initialization routine (single paramemter) */
+  void *reduce_init; /**< data initialization routine (single parameter) */
   void *reduce_fini; /**< data finalization routine */
   void *reduce_comb; /**< data combiner routine */
   unsigned flags; /**< flags for additional info from compiler */
diff --git a/openmp/runtime/test/worksharing/for/omp_for_schedule_static_3.c b/openmp/runtime/test/worksharing/for/omp_for_schedule_static_3.c
index 307445b..10bee86 100644
--- a/openmp/runtime/test/worksharing/for/omp_for_schedule_static_3.c
+++ b/openmp/runtime/test/worksharing/for/omp_for_schedule_static_3.c
@@ -150,7 +150,7 @@
    * same logical assignment of chunks to threads. We use the nowait
    * clause to increase the probability to get an error. */
 
-  /* First we allocate some more memmory */
+  /* First we allocate some more memory */
   free (tids);
   tids = (int *) malloc (sizeof (int) * LOOPCOUNT);
   tids2 = (int *) malloc (sizeof (int) * LOOPCOUNT);
diff --git a/openmp/runtime/tools/check-depends.pl b/openmp/runtime/tools/check-depends.pl
index 909df1c..3cd30c2 100755
--- a/openmp/runtime/tools/check-depends.pl
+++ b/openmp/runtime/tools/check-depends.pl
@@ -23,7 +23,7 @@
 my $target_arch;
 
 # --------------------------------------------------------------------------------------------------
-# Ouput parse error.
+# Output parse error.
 #     $tool -- Name of tool.
 #     @bulk -- Output of the tool.
 #     $n    -- Number of line caused parse error.
diff --git a/openmp/runtime/tools/check-execstack.pl b/openmp/runtime/tools/check-execstack.pl
index 34f77e1..e4a8e7c 100755
--- a/openmp/runtime/tools/check-execstack.pl
+++ b/openmp/runtime/tools/check-execstack.pl
@@ -74,7 +74,7 @@
 
 =head1 SYNOPSIS
 
-B<check-execstack.pl> I<optiion>... I<file>...
+B<check-execstack.pl> I<option>... I<file>...
 
 =head1 DESCRIPTION
 
diff --git a/openmp/runtime/tools/check-instruction-set.pl b/openmp/runtime/tools/check-instruction-set.pl
index 455210c..65c315d 100755
--- a/openmp/runtime/tools/check-instruction-set.pl
+++ b/openmp/runtime/tools/check-instruction-set.pl
@@ -124,7 +124,7 @@
 
     my $n = 0;
     my $errors = 0;
-    my $current_func  = "";    # Name of current fuction.
+    my $current_func  = "";    # Name of current function.
     my $reported_func = "";    # name of last reported function.
     foreach my $line ( @bulk ) {
         ++ $n;
diff --git a/openmp/runtime/tools/generate-def.pl b/openmp/runtime/tools/generate-def.pl
index a44306f..0298d72 100755
--- a/openmp/runtime/tools/generate-def.pl
+++ b/openmp/runtime/tools/generate-def.pl
@@ -152,7 +152,7 @@
         print( $bulk );
     }; # if
 
-}; # sub generate_ouput
+}; # sub generate_output
 
 #
 # Parse command line.
@@ -268,7 +268,7 @@
 =head1 DESCRIPTION
 
 The script reads input file, process conditional directives, checks content for consistency, and
-generates ouptput file suitable for linker.
+generates output file suitable for linker.
 
 =head2 Input File Format
 
@@ -287,7 +287,7 @@
     %endif
 
 A part of file surrounded by C<%ifdef I<name>> and C<%endif> directives is a conditional part -- it
-has effect only if I<name> is defined in the comman line by B<--define> option. C<%ifndef> is a
+has effect only if I<name> is defined in the command line by B<--define> option. C<%ifndef> is a
 negated version of C<%ifdef> -- conditional part has an effect only if I<name> is B<not> defined.
 
 Conditional parts may be nested.
diff --git a/openmp/runtime/tools/lib/Platform.pm b/openmp/runtime/tools/lib/Platform.pm
index 0a3a0cf..a6b158d 100644
--- a/openmp/runtime/tools/lib/Platform.pm
+++ b/openmp/runtime/tools/lib/Platform.pm
@@ -187,12 +187,12 @@
                 set_target_os( $_[ 1 ] ) or
                     die "Bad value of --target-os option: \"$_[ 1 ]\"\n";
             },
-        "target-architecture|targert-arch|architecture|arch=s" =>
+        "target-architecture|target-arch|architecture|arch=s" =>
            sub {
                set_target_arch( $_[ 1 ] ) or
                    die "Bad value of --target-architecture option: \"$_[ 1 ]\"\n";
            },
-        "target-mic-architecture|targert-mic-arch|mic-architecture|mic-arch=s" =>
+        "target-mic-architecture|target-mic-arch|mic-architecture|mic-arch=s" =>
            sub {
                set_target_mic_arch( $_[ 1 ] ) or
                    die "Bad value of --target-mic-architecture option: \"$_[ 1 ]\"\n";
@@ -390,7 +390,7 @@
     my $os     = canon_os( "Windows NT" );     # Returns "win".
 
     print( $host_arch, $host_os, $host_platform );
-    print( $taregt_arch, $target_os, $target_platform );
+    print( $target_arch, $target_os, $target_platform );
 
     tools::get_options(
         Platform::target_options(),
diff --git a/openmp/runtime/tools/lib/tools.pm b/openmp/runtime/tools/lib/tools.pm
index f5aba2b..bb088c9 100644
--- a/openmp/runtime/tools/lib/tools.pm
+++ b/openmp/runtime/tools/lib/tools.pm
@@ -87,7 +87,7 @@
 
 sub check_opts(\%$;$) {
 
-    my $opts = shift( @_ );  # Referense to hash containing real options and their values.
+    my $opts = shift( @_ );  # Reference to hash containing real options and their values.
     my $good = shift( @_ );  # Reference to an array containing all known option names.
     my $msg  = shift( @_ );  # Optional (non-mandatory) message.
 
@@ -237,7 +237,7 @@
 
 It is very simple wrapper arounf Getopt::Long::GetOptions. It passes all arguments to GetOptions,
 and add definitions for standard help options: --help, --doc, --verbose, and --quiet.
-When GetOptions finihes, this subroutine checks exit code, if it is non-zero, standard error
+When GetOptions finishes, this subroutine checks exit code, if it is non-zero, standard error
 message is issued and script terminated.
 
 If --verbose or --quiet option is specified, C<tools.pm_verbose> environment variable is set.
@@ -333,7 +333,7 @@
 B<Description:>
 
 Package variable. It determines verbosity level, which affects C<warning()>, C<info()>, and
-C<debug()> subroutnes .
+C<debug()> subroutines .
 
 The variable gets initial value from C<tools.pm_verbose> environment variable if it is exists.
 If the environment variable does not exist, variable is set to 2.
@@ -357,7 +357,7 @@
 B<Description:>
 
 Package variable. It determines whether C<debug()>, C<info()>, C<warning()>, C<runtime_error()>
-subroutnes print timestamps or not.
+subroutines print timestamps or not.
 
 The variable gets initial value from C<tools.pm_timestamps> environment variable if it is exists.
 If the environment variable does not exist, variable is set to false.
@@ -700,7 +700,7 @@
 
     my $echo = which( "echo" );
 
-Look for all occurenses of "cp" in the PATH:
+Look for all occurrences of "cp" in the PATH:
 
     my @cps = which( "cp", -all => 1 );
 
@@ -1488,7 +1488,7 @@
 
 =item B<$file>
 
-The name or handle of file to writte to.
+The name or handle of file to write to.
 
 =item B<$bulk>
 
diff --git a/openmp/tools/archer/README.md b/openmp/tools/archer/README.md
index b74f07b..7f50242 100644
--- a/openmp/tools/archer/README.md
+++ b/openmp/tools/archer/README.md
@@ -71,7 +71,7 @@
 ## Runtime Flags
 
 TSan runtime flags are passed via **TSAN&#95;OPTIONS** environment variable,
-we highly recommend the following option to aviod false alerts for the
+we highly recommend the following option to avoid false alerts for the
 OpenMP or MPI runtime implementation:
 
     export TSAN_OPTIONS="ignore_noninstrumented_modules=1"
diff --git a/openmp/tools/archer/ompt-tsan.cpp b/openmp/tools/archer/ompt-tsan.cpp
index e6c3f9f..d83cf04 100644
--- a/openmp/tools/archer/ompt-tsan.cpp
+++ b/openmp/tools/archer/ompt-tsan.cpp
@@ -258,7 +258,7 @@
       T data;
     };
     // We alloc without initialize the memory. We cannot call constructors.
-    // Therfore use malloc!
+    // Therefore use malloc!
     pooldata *datas = (pooldata *)malloc(sizeof(pooldata) * N);
     memory.push_back(datas);
     for (int i = 0; i < N; i++) {