Skip to content

Commit a45c783

Browse files
[InstrProf] Change step from 64-bit to pointer-sized int
Fixed 64-bit step can lead to creating atomic instructions unsupported by the target architecture (see rust-lang/rust#112313).
1 parent 6008cd4 commit a45c783

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/IR/IntrinsicInst.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ Value *InstrProfIncrementInst::getStep() const {
288288
}
289289
const Module *M = getModule();
290290
LLVMContext &Context = M->getContext();
291-
return ConstantInt::get(Type::getInt64Ty(Context), 1);
291+
const auto &DL = M->getDataLayout();
292+
return ConstantInt::get(DL.getIntPtrType(Context), 1);
292293
}
293294

294295
std::optional<RoundingMode> ConstrainedFPIntrinsic::getRoundingMode() const {

0 commit comments

Comments
 (0)