[Chapel Merge] GPU Kernel Conditional Statement Bug Fix

Branch: refs/heads/main
Revision: 98dccc4
Author: ShreyasKhandekar
Link: GPU Kernel Conditional Statement Bug Fix by ShreyasKhandekar · Pull Request #20357 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #20357 from ShreyasKhandekar/GPUcondStmtBug

GPU Kernel Conditional Statement Bug Fix

Fixing a bug in the compiler where if a GPUizable loop has a conditional statement whose expression comes from outside the loop, we do not add it as a argument to the code generated for the kernel.

Added conditions in gpuTransforms.cpp so that it adds that expression as a kernel argument.

Also added a catch-all else block that causes an error if there happen to be any other such cases where we forget to add a compiler argument.

Added a test which fails on main but passes with this fix.

Modified Files:
M compiler/optimizations/gpuTransforms.cpp

M test/gpu/native/innerBlock.chpl
M test/gpu/native/innerBlock.good

Compare: https://github.com/chapel-lang/chapel/compare/5f7e4f1d58ea...98dccc4c7dbd