This is an archive of the discontinued LLVM Phabricator instance.

[ASAN] NFC: Use addrspace cast for pointers in non-zero addrspace
ClosedPublic

Authored by rksharma on Apr 27 2021, 6:53 AM.

Details

Summary

Pointers in non-zero address spaces need to be address space casted before appending to the used list.

Diff Detail

Event Timeline

rksharma created this revision.Apr 27 2021, 6:53 AM
rksharma requested review of this revision.Apr 27 2021, 6:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2021, 6:53 AM
vitalybuka accepted this revision.Apr 28 2021, 1:21 PM
This revision is now accepted and ready to land.Apr 28 2021, 1:21 PM

Is this testable? Was it already tested and the test was asserting in some case? Is it not testable for some reason?

The change in this patch is implicitly tested by all the tests introduced in https://reviews.llvm.org/D99071
asan-module pass will append globals to the used list and for AMDGPU these globals will be in non-zero addrspaces.

The change in this patch is implicitly tested by all the tests introduced in https://reviews.llvm.org/D99071
asan-module pass will append globals to the used list and for AMDGPU these globals will be in non-zero addrspaces.

In the future - semantic changing patches should be part of commits that test them, not committed separately.

If this change was separable, it should've included separate tests with it - such as an IR test with a global in the used list, by the sounds of it?

It does make sense. Like other Utils, I've created ModuleUtilsTest where I've added tests for appending into UsedList. Please take a look, https://reviews.llvm.org/D101746

Sorry, somehow I missed that the function is not just internal Asan utility.
David, thanks for rising this up.

The change in this patch is implicitly tested by all the tests introduced in https://reviews.llvm.org/D99071
asan-module pass will append globals to the used list and for AMDGPU these globals will be in non-zero addrspaces.

In the future - semantic changing patches should be part of commits that test them, not committed separately.

If this change was separable, it should've included separate tests with it - such as an IR test with a global in the used list, by the sounds of it?

The change in this patch is implicitly tested by all the tests introduced in https://reviews.llvm.org/D99071
asan-module pass will append globals to the used list and for AMDGPU these globals will be in non-zero addrspaces.

In the future - semantic changing patches should be part of commits that test them, not committed separately.

If this change was separable, it should've included separate tests with it - such as an IR test with a global in the used list, by the sounds of it?