File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -253,8 +253,8 @@ bool AMDGPUSubtarget::isMesaKernel(const Function &F) const {
253253unsigned AMDGPUSubtarget::getMaxWorkitemID (const Function &Kernel,
254254 unsigned Dimension) const {
255255 std::optional<unsigned > ReqdSize = getReqdWorkGroupSize (Kernel, Dimension);
256- if (ReqdSize. has_value () )
257- return ReqdSize. value () - 1 ;
256+ if (ReqdSize)
257+ return * ReqdSize - 1 ;
258258 return getFlatWorkGroupSizes (Kernel).second - 1 ;
259259}
260260
@@ -306,7 +306,7 @@ bool AMDGPUSubtarget::makeLIDRangeMetadata(Instruction *I) const {
306306
307307 if (Dim <= 3 ) {
308308 std::optional<unsigned > ReqdSize = getReqdWorkGroupSize (*Kernel, Dim);
309- if (ReqdSize. has_value () )
309+ if (ReqdSize)
310310 MinSize = MaxSize = *ReqdSize;
311311 }
312312 }
Original file line number Diff line number Diff line change @@ -1012,12 +1012,12 @@ bool GCNTTIImpl::isSourceOfDivergence(const Value *V) const {
10121012 // Similarly, if the dimension has size 1, it is also uniform.
10131013 const Function *F = Intrinsic->getFunction ();
10141014 std::optional<unsigned > ReqdXDimSize = ST->getReqdWorkGroupSize (*F, 0 );
1015- if (ReqdXDimSize. has_value () && isPowerOf2_32 (*ReqdXDimSize) &&
1015+ if (ReqdXDimSize && isPowerOf2_32 (*ReqdXDimSize) &&
10161016 *ReqdXDimSize >= ST->getWavefrontSize ())
10171017 return false ;
10181018 std::optional<unsigned > ThisDimSize = ST->getReqdWorkGroupSize (
10191019 *F, IID == Intrinsic::amdgcn_workitem_id_y ? 1 : 2 );
1020- return !( ThisDimSize. has_value () && *ThisDimSize == 1 ) ;
1020+ return !ThisDimSize || *ThisDimSize != 1 ;
10211021 }
10221022 default :
10231023 return AMDGPU::isIntrinsicSourceOfDivergence (IID);
You can’t perform that action at this time.
0 commit comments