diff options
author | Alexey Bataev <a.bataev@outlook.com> | 2023-11-02 09:29:25 -0700 |
---|---|---|
committer | Alexey Bataev <a.bataev@outlook.com> | 2023-11-02 10:37:38 -0700 |
commit | 495ed8d8c8b3795dd51595aad7a192189f2cfeab (patch) | |
tree | acf4589ef76eb50953626d7f5b16d1693f6094dd /llvm/lib | |
parent | d483abd0fdd032c4169f8fcaedd2bc63986f7a40 (diff) | |
download | llvm-495ed8d8c8b3795dd51595aad7a192189f2cfeab.zip llvm-495ed8d8c8b3795dd51595aad7a192189f2cfeab.tar.gz llvm-495ed8d8c8b3795dd51595aad7a192189f2cfeab.tar.bz2 |
[SLP]Fix PR70507: freeze poisonous insts to avoid poison propagation.
If the reduction instruction is not bool logical op, but reduced within bool logical op reduction list, need to freeze to avoid poison propagation.
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index 14d2bcf..66608d0 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -14616,15 +14616,15 @@ public: Instruction *RedOp1, Instruction *RedOp2, bool InitStep) { - if (!isBoolLogicOp(RedOp1)) + if (!AnyBoolLogicOp) return; - if ((!InitStep && LHS == VectorizedTree) || - getRdxOperand(RedOp1, 0) == LHS || isGuaranteedNotToBePoison(LHS)) + if (isBoolLogicOp(RedOp1) && + ((!InitStep && LHS == VectorizedTree) || + getRdxOperand(RedOp1, 0) == LHS || isGuaranteedNotToBePoison(LHS))) return; - if (!isBoolLogicOp(RedOp2)) - return; - if ((!InitStep && RHS == VectorizedTree) || - getRdxOperand(RedOp2, 0) == RHS || isGuaranteedNotToBePoison(RHS)) { + if (isBoolLogicOp(RedOp2) && ((!InitStep && RHS == VectorizedTree) || + getRdxOperand(RedOp2, 0) == RHS || + isGuaranteedNotToBePoison(RHS))) { std::swap(LHS, RHS); return; } |