Skip to content

Commit d29fbb4

Browse files
committed
add comment
1 parent 84ae923 commit d29fbb4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/lib/Transforms/Vectorize/VectorCombine.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)