[llvm] 1d3d9b9 - [OpenMPOpt][NFC] Moving constants as struct static attributes
Hamilton Tobon Mosquera via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 31 17:05:22 PDT 2020
Author: Hamilton Tobon Mosquera
Date: 2020-08-31T19:05:00-05:00
New Revision: 1d3d9b9cd808ef37f3dacd3ada81bff1353cd24b
URL: https://github.com/llvm/llvm-project/commit/1d3d9b9cd808ef37f3dacd3ada81bff1353cd24b
DIFF: https://github.com/llvm/llvm-project/commit/1d3d9b9cd808ef37f3dacd3ada81bff1353cd24b.diff
LOG: [OpenMPOpt][NFC] Moving constants as struct static attributes
Added:
Modified:
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
index bd4e2f769af0..8dfe42ebc27b 100644
--- a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
+++ b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
@@ -407,6 +407,10 @@ struct OffloadArray {
return true;
}
+ static const unsigned BasePtrsArgNum = 2;
+ static const unsigned PtrsArgNum = 3;
+ static const unsigned SizesArgNum = 4;
+
private:
/// Traverses the BasicBlock where \p Array is, collecting the stores made to
/// \p Array, leaving StoredValues with the values stored before the
@@ -705,14 +709,12 @@ struct OpenMPOpt {
// offload arrays, offload_baseptrs, offload_ptrs, offload_sizes.
// Therefore:
// i8** %offload_baseptrs.
- const unsigned BasePtrsArgNum = 2;
- Value *BasePtrsArg = RuntimeCall.getArgOperand(BasePtrsArgNum);
+ Value *BasePtrsArg =
+ RuntimeCall.getArgOperand(OffloadArray::BasePtrsArgNum);
// i8** %offload_ptrs.
- const unsigned PtrsArgNum = 3;
- Value *PtrsArg = RuntimeCall.getArgOperand(PtrsArgNum);
+ Value *PtrsArg = RuntimeCall.getArgOperand(OffloadArray::PtrsArgNum);
// i8** %offload_sizes.
- const unsigned SizesArgNum = 4;
- Value *SizesArg = RuntimeCall.getArgOperand(SizesArgNum);
+ Value *SizesArg = RuntimeCall.getArgOperand(OffloadArray::SizesArgNum);
// Get values stored in **offload_baseptrs.
auto *V = getUnderlyingObject(BasePtrsArg);
More information about the llvm-commits
mailing list