Skip to content

Commit b0b95da

Browse files
committed
[VectorCombine] add safety check for 0-width register
Based on post-commit discussion in D81766, Hexagon sets this to "0". I'll see if I can come up with a test, but making the obvious code fix first to unblock that target.
1 parent 2985c02 commit b0b95da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/Vectorize/VectorCombine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ bool VectorCombine::vectorizeLoadInsert(Instruction &I) {
107107

108108
unsigned VectorSize = TTI.getMinVectorRegisterBitWidth();
109109
uint64_t ScalarSize = ScalarTy->getPrimitiveSizeInBits();
110-
if (!ScalarSize || VectorSize % ScalarSize != 0)
110+
if (!ScalarSize || !VectorSize || VectorSize % ScalarSize != 0)
111111
return false;
112112

113113
// Check safety of replacing the scalar load with a larger vector load.

0 commit comments

Comments
 (0)