Skip to content

Commit dc831e8

Browse files
committed
[OMPIRBuilder] Use getAllOnesValue()
Split out from #80309.
1 parent db3c3fc commit dc831e8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5907,7 +5907,7 @@ CallInst *OpenMPIRBuilder::createOMPInteropInit(
59075907
Value *Ident = getOrCreateIdent(SrcLocStr, SrcLocStrSize);
59085908
Value *ThreadId = getOrCreateThreadID(Ident);
59095909
if (Device == nullptr)
5910-
Device = ConstantInt::get(Int32, -1);
5910+
Device = Constant::getAllOnesValue(Int32);
59115911
Constant *InteropTypeVal = ConstantInt::get(Int32, (int)InteropType);
59125912
if (NumDependences == nullptr) {
59135913
NumDependences = ConstantInt::get(Int32, 0);
@@ -5935,7 +5935,7 @@ CallInst *OpenMPIRBuilder::createOMPInteropDestroy(
59355935
Value *Ident = getOrCreateIdent(SrcLocStr, SrcLocStrSize);
59365936
Value *ThreadId = getOrCreateThreadID(Ident);
59375937
if (Device == nullptr)
5938-
Device = ConstantInt::get(Int32, -1);
5938+
Device = Constant::getAllOnesValue(Int32);
59395939
if (NumDependences == nullptr) {
59405940
NumDependences = ConstantInt::get(Int32, 0);
59415941
PointerType *PointerTypeVar = PointerType::getUnqual(M.getContext());
@@ -5963,7 +5963,7 @@ CallInst *OpenMPIRBuilder::createOMPInteropUse(const LocationDescription &Loc,
59635963
Value *Ident = getOrCreateIdent(SrcLocStr, SrcLocStrSize);
59645964
Value *ThreadId = getOrCreateThreadID(Ident);
59655965
if (Device == nullptr)
5966-
Device = ConstantInt::get(Int32, -1);
5966+
Device = Constant::getAllOnesValue(Int32);
59675967
if (NumDependences == nullptr) {
59685968
NumDependences = ConstantInt::get(Int32, 0);
59695969
PointerType *PointerTypeVar = PointerType::getUnqual(M.getContext());
@@ -6104,7 +6104,7 @@ OpenMPIRBuilder::createTargetInit(const LocationDescription &Loc, bool IsSPMD,
61046104
Builder.CreateCall(Fn, {KernelEnvironment, KernelLaunchEnvironment});
61056105

61066106
Value *ExecUserCode = Builder.CreateICmpEQ(
6107-
ThreadKind, ConstantInt::get(ThreadKind->getType(), -1),
6107+
ThreadKind, Constant::getAllOnesValue(ThreadKind->getType()),
61086108
"exec_user_code");
61096109

61106110
// ThreadKind = __kmpc_target_init(...)

0 commit comments

Comments
 (0)