llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[FuzzMutate] Prevent the mutator from generating illegal memory operations

Open mgcarrasco opened this issue 1 year ago • 4 comments

This PR prevents the mutator from generating illegal memory operations for AMDGCN. In particular, direct store and load instructions on addrspace(8) are not permitted. This PR fixes that by properly introducing casts to addrspace(7) when required.

mgcarrasco avatar Jun 19 '25 12:06 mgcarrasco

:white_check_mark: With the latest revision this PR passed the C/C++ code formatter.

github-actions[bot] avatar Jun 19 '25 12:06 github-actions[bot]

Can you attach an AMDGCN specific test case? IIUC the isAMDGCN branch you added won't be tested by current test cases at all.

DataCorrupted avatar Jun 24 '25 17:06 DataCorrupted

@DataCorrupted thanks for the review. I'll provide the unit test.

mgcarrasco avatar Jun 27 '25 09:06 mgcarrasco

@DataCorrupted thanks again for the feedback. I've added a unit test. We are also planning to incorporate this check into the Verifier in an independent PR. Once that is done, I can also remove the adhoc check for addrspace 8 in a new PR.

mgcarrasco avatar Jun 30 '25 12:06 mgcarrasco

The last failure looks unrelated to this PR. I have just rebased to try again.

mgcarrasco avatar Jun 30 '25 15:06 mgcarrasco

Thanks @DataCorrupted, I missed those cases.

mgcarrasco avatar Jul 02 '25 09:07 mgcarrasco

@DataCorrupted thanks again for your review and feedback. I've addressed the remaining comments. In case the latest changes look good to you, I think the PR could be merged.

mgcarrasco avatar Jul 04 '25 09:07 mgcarrasco