Skip to content

Commit 6dbeb2e

Browse files
[SYCL] Move integer conversion out of assert (#7329)
Converting the aspect values in sycl-device-has in the SYCL propagate aspect usage pass was unintentionally done inside an assert. This causes the conversion to not take place when asserts are disabled. This commit moves the conversion out of the assertion. Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 3159db5 commit 6dbeb2e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/SYCLLowerIR/SYCLPropagateAspectsUsage.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,10 @@ void validateUsedAspectsForFunctions(const FunctionToAspectsMapTy &Map,
343343
AspectValStrs, ',', /*MaxSplit=*/-1, /*KeepEmpty=*/false);
344344
for (StringRef AspectValStr : AspectValStrs) {
345345
int AspectVal = -1;
346-
assert(!AspectValStr.getAsInteger(10, AspectVal) &&
346+
bool AspectValStrConverted = !AspectValStr.getAsInteger(10, AspectVal);
347+
// Avoid unused warning when asserts are disabled.
348+
std::ignore = AspectValStrConverted;
349+
assert(AspectValStrConverted &&
347350
"Aspect value in sycl-device-has is not an integer.");
348351
DeviceHasAspectSet.insert(AspectVal);
349352
}

0 commit comments

Comments
 (0)