[SYCL] Fix function attribute merging on template declarations (#21158)
#20419 implements attribute merging for `add_ir_attributes_*`
attributes. This commit fixes an issue that occurs when merging
attributes on function template declarations.
Attribute merging is deferred until template instantiation if an
attribute contains dependent expressions. Previously, we only checked if
the existing attribute was dependent but not if the new attribute was
dependent. This would cause the merge to fail but the new attribute
would still be dropped from the AST. This commit ensures both attributes
are checked and new dependent attributes do not disappear.
---------
Signed-off-by: Michael Aziz <michael.aziz@intel.com>