[PATCH] D29879: [OpenMP] Teams reduction on the NVPTX device.

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 16 04:16:19 PST 2017


ABataev added inline comments.


================
Comment at: lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp:715
+    // lane_offset, int16_t shortCircuit),
+    // void (*kmp_InterWarpCopyFctPtr)(void* src, int warp_num),
+    // void (*kmp_CopyToScratchpadFctPtr)(void *reduce_data, void * scratchpad,
----------------
`int32_t`, not `int`


================
Comment at: lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp:1040-1041
+                                  llvm::Value *RemoteLaneOffset = nullptr,
+                                  llvm::Value *ScratchpadIndex = nullptr,
+                                  llvm::Value *ScratchpadWidth = nullptr) {
 
----------------
To many params already, try to join them in the struct.


================
Comment at: lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp:1255
+                             /*Id=*/nullptr,
+                             C.getIntTypeForBitwidth(32, /* Signed */ true));
+  // Row width of an element in the scratchpad array, typically
----------------
It is better to create `Int32Ty` att the beginning of the function rather than call `C.getIntTypeForBitwidth()` each time


================
Comment at: lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp:1393
+                             /*Id=*/nullptr,
+                             C.getIntTypeForBitwidth(32, /* Signed */ true));
+
----------------
It is better to create `Int32Ty` att the beginning of the function rather than call `C.getIntTypeForBitwidth()` each time


https://reviews.llvm.org/D29879





More information about the cfe-commits mailing list