[llvm] [clang] [mlir] [clang-tools-extra] [ASan][AMDGPU] Fix Assertion Failure. (PR #78242)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 16 02:20:04 PST 2024


================
@@ -1254,9 +1254,11 @@ Value *AddressSanitizer::memToShadow(Value *Shadow, IRBuilder<> &IRB) {
 void AddressSanitizer::instrumentMemIntrinsic(MemIntrinsic *MI) {
   InstrumentationIRBuilder IRB(MI);
   if (isa<MemTransferInst>(MI)) {
-    IRB.CreateCall(isa<MemMoveInst>(MI) ? AsanMemmove : AsanMemcpy,
-                   {MI->getOperand(0), MI->getOperand(1),
-                    IRB.CreateIntCast(MI->getOperand(2), IntptrTy, false)});
+    IRB.CreateCall(
+        isa<MemMoveInst>(MI) ? AsanMemmove : AsanMemcpy,
+        {MI->getOperand(0),
+         IRB.CreatePointerBitCastOrAddrSpaceCast(MI->getOperand(1), PtrTy),
----------------
arsenm wrote:

No reason to create pointer bit casts anymore. Just CreateAddrSpaceCast? 

https://github.com/llvm/llvm-project/pull/78242


More information about the cfe-commits mailing list