[llvm] [InstrProf] Change step from 64-bit to pointer-sized int (PR #83239)
Jovan Dmitrović via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 1 07:59:24 PST 2024
================
@@ -288,7 +288,8 @@ Value *InstrProfIncrementInst::getStep() const {
}
const Module *M = getModule();
LLVMContext &Context = M->getContext();
- return ConstantInt::get(Type::getInt64Ty(Context), 1);
+ const auto &DL = M->getDataLayout();
+ return ConstantInt::get(DL.getIntPtrType(Context), 1);
----------------
jdmitrovic-syrmia wrote:
I see. I pushed some changes, creating additional `getStep` function for atomics. This way, we can use a larger type.
Also, I've taken the liberty of changing the existing code to use the largest legal int available instead of the 64-bit int.
https://github.com/llvm/llvm-project/pull/83239
More information about the llvm-commits
mailing list