llvm icon indicating copy to clipboard operation
llvm copied to clipboard

[SYCL] Make PropertySetRegistry being owning it's content

Open maksimsab opened this issue 1 year ago • 6 comments

Before this patch PropertySetRegistry used StringRefs that point at external data that was supposed to outlive the instance of PropertySetRegistry. It wasn't obvious and it might lead to memory bugs. This patch makes PropertySetRegistry owning it's content as containers usually do.

Also documentation is aligned with doxygen BKSM.

maksimsab avatar Feb 01 '24 17:02 maksimsab

From test's failures it looks like we can't simply change the order of spec const's IDs in metadata.

maksimsab avatar Feb 05 '24 14:02 maksimsab

Status update: Initially I made a change that removes the order of elements in PropertyRegistry. Later on I found out that the current SpecConsts pass rely on that property and this is difficult to adopt the pass to the missing order of elements or sorted order of elements. I decided to return this property back. This PR still has a fix of data owning that removes UB with use of freed data.

maksimsab avatar Feb 09 '24 17:02 maksimsab

@asudarsa Could you please review this when you have free time?

maksimsab avatar Feb 09 '24 17:02 maksimsab

Hi @maksimsab

I think such changes to core LLVM files should be directly made upstream, I would advise to split this into two PR. One upstream PR to change code inside PropertySetIO files and once that change is done, you can make the changes to sycl-post-link on top of it.

Thanks

asudarsa avatar Feb 13 '24 18:02 asudarsa

Hi @asudarsa

PropertySetIO doesn't belong to llvm-project.

maksimsab avatar Feb 14 '24 10:02 maksimsab

Hi @asudarsa

PropertySetIO doesn't belong to llvm-project.

Oh. You are right. Sorry a miss on my part. One more thing to upstream then

asudarsa avatar Feb 14 '24 15:02 asudarsa

The pre-commit failure is known and has been reported already in https://github.com/intel/llvm/pull/12791. I don't think it's related to these changes.

maarquitos14 avatar Mar 08 '24 10:03 maarquitos14