[llvm] 983bf65 - [NFC][msan] Extract `handleSelectLikeInst` (#94881)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 10 13:12:04 PDT 2024


Author: Vitaly Buka
Date: 2024-06-10T13:12:00-07:00
New Revision: 983bf657945e4e400997b127fe4a7b644d63c047

URL: https://github.com/llvm/llvm-project/commit/983bf657945e4e400997b127fe4a7b644d63c047
DIFF: https://github.com/llvm/llvm-project/commit/983bf657945e4e400997b127fe4a7b644d63c047.diff

LOG: [NFC][msan] Extract `handleSelectLikeInst` (#94881)

`blendv` instructions are very similar to `select`.
We will add support for them in followup patches.

Added: 
    

Modified: 
    llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
index 0d45bc3bfebdc..ffb4e5b94c20b 100644
--- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
@@ -4481,12 +4481,17 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
   }
 
   void visitSelectInst(SelectInst &I) {
-    IRBuilder<> IRB(&I);
     // a = select b, c, d
     Value *B = I.getCondition();
     Value *C = I.getTrueValue();
     Value *D = I.getFalseValue();
 
+    handleSelectLikeInst(I, B, C, D);
+  }
+
+  void handleSelectLikeInst(Instruction &I, Value *B, Value *C, Value *D) {
+    IRBuilder<> IRB(&I);
+
     Value *Sb = getShadow(B);
     Value *Sc = getShadow(C);
     Value *Sd = getShadow(D);


        


More information about the llvm-commits mailing list