[PATCH] D126270: [InstCombine] Preserve !nosanitize for newly created instructions.

Mingjie Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 24 21:41:21 PDT 2022


Enna1 updated this revision to Diff 431879.
Enna1 edited the summary of this revision.
Enna1 added a comment.

Update patch


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126270/new/

https://reviews.llvm.org/D126270

Files:
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp


Index: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
===================================================================
--- llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -4191,8 +4191,9 @@
 
     // Now that we have an instruction, try combining it to simplify it.
     Builder.SetInsertPoint(I);
-    Builder.CollectMetadataToCopy(
-        I, {LLVMContext::MD_dbg, LLVMContext::MD_annotation});
+    Builder.CollectMetadataToCopy(I, {LLVMContext::MD_dbg,
+                                      LLVMContext::MD_annotation,
+                                      LLVMContext::MD_nosanitize});
 
 #ifndef NDEBUG
     std::string OrigI;
@@ -4208,7 +4209,8 @@
                           << "    New = " << *Result << '\n');
 
         Result->copyMetadata(*I,
-                             {LLVMContext::MD_dbg, LLVMContext::MD_annotation});
+                             {LLVMContext::MD_dbg, LLVMContext::MD_annotation,
+                              LLVMContext::MD_nosanitize});
         // Everything uses the new instruction now.
         I->replaceAllUsesWith(Result);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126270.431879.patch
Type: text/x-patch
Size: 1162 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220525/bef59e96/attachment.bin>


More information about the llvm-commits mailing list