20496, "vasslitvinov", "optimization opportunity: '(non-param) && false'", "2022-08-24T02:47:35Z"
Currently this code in CyclicDist.chpl:
proc CyclicArr.dsiAccess(i:rank*idxType) ref {
local {
if const myLocArrNN = myLocArr then
if myLocArrNN.locDom.contains(i) then
return myLocArrNN.this(i);
}
if doRADOpt && !stridable { <-------- // the 'if' in question
if const myLocArr = this.myLocArr {
........
executes the then-branch even when stridable
is a param true. I expected the then-branch to be param-eliminated in this case and it took me time to figure out that it was not.
This issue proposes the optimization -- or even semantics -- to make the condition of this 'if' be param false when stridable is a param true.
Test: TBD