File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -872,11 +872,13 @@ bool VectorCombine::foldBitOpOfCastops(Instruction &I) {
872872
873873 auto *SrcTy = LHSSrc->getType ();
874874 auto *DstTy = I.getType ();
875- // Only handle vector types with integer elements if the cast is not bitcast
875+ // Bitcasts can handle scalar/vector mixes, such as i16 -> <16 x i1>.
876+ // Other casts only handle vector types with integer elements.
876877 if (CastOpcode != Instruction::BitCast &&
877878 (!isa<FixedVectorType>(SrcTy) || !isa<FixedVectorType>(DstTy)))
878879 return false ;
879880
881+ // Only integer scalar/vector values are legal for bitwise logic operations.
880882 if (!SrcTy->getScalarType ()->isIntegerTy () ||
881883 !DstTy->getScalarType ()->isIntegerTy ())
882884 return false ;
You can’t perform that action at this time.
0 commit comments