[AMDGPU] Gate fold_pow(x, ±0.5)->sqrt/rsqrt on nsz+ninf fast-math flags (#205592)
AMDGPULibCalls::fold_pow rewrote pow(x, 0.5)->sqrt(x) and pow(x,
-0.5)->rsqrt(x) unconditionally, firing before the
isUnsafeFiniteOnlyMath guard. This is incorrect for two IEEE corner
cases:
pow(-Inf, 0.5) == +Inf but sqrt(-Inf) == NaN
pow(-0.0, 0.5) == +0.0 but sqrt(-0.0) == -0.0
Guard the fold on hasNoSignedZeros() && (IsPowr || hasNoInfs()), where
IsPowr is true for powr/powr_fast. The OpenCL spec requires x >= 0 for
powr, so -Inf is undefined behaviour and the ninf check can be skipped;
-0.0 is a valid input for powr since -0.0 >= 0 by IEEE comparison, so
nsz is still required for all variants. afn alone is not sufficient
since it only permits approximate results and says nothing about the
treatment of infinities or signed zeros.
Update the four autogenerated test files to reflect the new semantics:
[4 lines not shown]
[AMDGPU] Guard block-count upgrade against volatile/atomic grid-size … (#208068)
…loads
AMDGPULowerKernelAttributes upgrades the pre-COV5 pattern
udiv(grid_size_x, group_size_x)
to a direct load of hidden_block_count_x from the implicit args. The
m_Load() pattern matcher does not check whether the matched load is
volatile or atomic, so a volatile or atomic grid_size load would have
been silently deleted and replaced -- dropping its observable side
effects in violation of the LangRef.
Fix: after the pattern match succeeds, cast the matched value to
LoadInst and bail out if !isSimple() (i.e., volatile or atomic).
Add a test case num_blocks_x_volatile_grid_size in
implicit-arg-block-count.ll to verify the volatile load and udiv are
preserved unchanged.
www/gitlab: Update RUN_DEPENDS
- Change RUN_DEPENDS from rubygem-json to rubygem-json-gitlab
- Change RUN_DEPENDS from rubygem-nkf to rubygem-nkf-gitlab
- Change RUN_DEPENDS from rubygem-sys-filesystem to rubygem-sys-filesystem-gitlab
- Bump PORTREVISION for dependency change
www/redmine60: Update RUN_DEPENDS
- Fix Gemfile for rubygem-i18n 1.15.0 update
- Change RUN_DEPENDS from rubygem-rouge to rubygem-rouge4
- Bump PORTREVISION for dependency and package change