Skip to content
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

[NFC][msan] Extract handleSelectLikeInst #94881

Merged

Conversation

vitalybuka
Copy link
Collaborator

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

@llvmbot
Copy link
Collaborator

llvmbot commented Jun 9, 2024

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

@llvm/pr-subscribers-llvm-transforms

Author: Vitaly Buka (vitalybuka)

Changes

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


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

1 Files Affected:

  • (modified) llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp (+6-1)
diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
index d312b0107932b..3993a9290607d 100644
--- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
@@ -4557,12 +4557,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);

@vitalybuka vitalybuka requested a review from thurstond June 9, 2024 02:22
Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
@vitalybuka vitalybuka changed the base branch from users/vitalybuka/spr/main.nfcmsan-extract-handleselectlikeinst to main June 10, 2024 20:09
Created using spr 1.3.4
@vitalybuka vitalybuka merged commit 983bf65 into main Jun 10, 2024
4 of 6 checks passed
@vitalybuka vitalybuka deleted the users/vitalybuka/spr/nfcmsan-extract-handleselectlikeinst branch June 10, 2024 20:12
Lukacma pushed a commit to Lukacma/llvm-project that referenced this pull request Jun 12, 2024
`blendv` instructions are very similar to `select`.
We will add support for them in followup patches.
@HerrCai0907 HerrCai0907 mentioned this pull request Jun 13, 2024
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.

4 participants