[llvm] [InstCombine] Fix a cycle when folding fneg(select) with scalable vector types (PR #112465)

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 16 00:09:33 PDT 2024


================
@@ -2878,7 +2878,8 @@ Instruction *InstCombinerImpl::visitFNeg(UnaryOperator &I) {
 
     // -(Cond ? X : C) --> Cond ? -X : -C
     // -(Cond ? C : Y) --> Cond ? -C : -Y
-    if (match(X, m_ImmConstant()) || match(Y, m_ImmConstant())) {
+    if ((match(X, m_ImmConstant()) && !isa<ScalableVectorType>(X->getType())) ||
----------------
ssijaric-nv wrote:

Thanks for having a look, Yingwei.  I'll test and upload the revised version.

https://github.com/llvm/llvm-project/pull/112465


More information about the llvm-commits mailing list