Skip to content

[MSan] Update type for MsanMetadataPtrForLoadN and MsanMetadataPtrForStoreN #135040

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 9, 2025

Conversation

k-kashapov
Copy link
Contributor

@k-kashapov k-kashapov commented Apr 9, 2025

Changed last parameter type for MsanMetadataPtrForLoadN and MsanMetadataPtrForStoreN from i64 to IntptrTy to keep it consistent with call in getShadowOriginPtrKernelNoVec

* Changed last parameter type from i64 to IntptrTy to keep it
  consistent with call in getShadowOriginPtrKernelNoVec
@llvmbot
Copy link
Member

llvmbot commented Apr 9, 2025

@llvm/pr-subscribers-compiler-rt-sanitizer

@llvm/pr-subscribers-llvm-transforms

Author: None (k-kashapov)

Changes

Changed last parameter type for MsanMetadataPtrForLoadN and MsanMetadataPtrForStoreN from i64 to IntptrTy to keep it consistent with call in getShadowOriginPtrKernelNoVec

Ping @vitalybuka


Full diff: https://github.com/llvm/llvm-project/pull/135040.diff

1 Files Affected:

  • (modified) llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp (+2-2)
diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
index 0a7a1f2ebbf4c..820ca3eec36cf 100644
--- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
@@ -846,9 +846,9 @@ void MemorySanitizer::createKernelApi(Module &M, const TargetLibraryInfo &TLI) {
   }
 
   MsanMetadataPtrForLoadN = getOrInsertMsanMetadataFunction(
-      M, "__msan_metadata_ptr_for_load_n", PtrTy, IRB.getInt64Ty());
+      M, "__msan_metadata_ptr_for_load_n", PtrTy, IntptrTy);
   MsanMetadataPtrForStoreN = getOrInsertMsanMetadataFunction(
-      M, "__msan_metadata_ptr_for_store_n", PtrTy, IRB.getInt64Ty());
+      M, "__msan_metadata_ptr_for_store_n", PtrTy, IntptrTy);
 
   // Functions for poisoning and unpoisoning memory.
   MsanPoisonAllocaFn = M.getOrInsertFunction(

Copy link
Collaborator

@vitalybuka vitalybuka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for Kernel and it's declared there as uintptr_t, so LGTM.

@vitalybuka vitalybuka merged commit f76d9da into llvm:main Apr 9, 2025
14 checks passed
@vitalybuka
Copy link
Collaborator

@k-kashapov This looks redundant. Probably settings of your local checkout need to be updated.

image

AllinLeeYL pushed a commit to AllinLeeYL/llvm-project that referenced this pull request Apr 10, 2025
…StoreN (llvm#135040)

Changed last parameter type for `MsanMetadataPtrForLoadN` and
`MsanMetadataPtrForStoreN` from `i64` to `IntptrTy` to keep it
consistent with call in `getShadowOriginPtrKernelNoVec`

Co-authored-by: Kamil Kashapov <[email protected]>
var-const pushed a commit to ldionne/llvm-project that referenced this pull request Apr 17, 2025
…StoreN (llvm#135040)

Changed last parameter type for `MsanMetadataPtrForLoadN` and
`MsanMetadataPtrForStoreN` from `i64` to `IntptrTy` to keep it
consistent with call in `getShadowOriginPtrKernelNoVec`

Co-authored-by: Kamil Kashapov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants