[llvm] f116107 - [VectorCombine] Don't touch instruction after foldSingleElementStore, it might be deleted

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 12:13:38 PST 2022


Author: Benjamin Kramer
Date: 2022-11-22T21:12:42+01:00
New Revision: f116107f2d9342dabf8f1ccecb3f33f9b85d9b48

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

LOG: [VectorCombine] Don't touch instruction after foldSingleElementStore, it might be deleted

Use after free found by asan.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/VectorCombine.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
index fe80158474283..4d0ebd4d0599c 100644
--- a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
+++ b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
@@ -1756,7 +1756,7 @@ bool VectorCombine::run() {
         MadeChange |= foldExtractExtract(I);
         break;
       default:
-        if (I.isBinaryOp()) {
+        if (Instruction::isBinaryOp(Opcode)) {
           MadeChange |= foldExtractExtract(I);
           MadeChange |= foldExtractedCmps(I);
         }


        


More information about the llvm-commits mailing list