HexagonVectorCombine.cpp - don't negate a bool value. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 10 May 2021 09:49:08 +0000 (10:49 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 10 May 2021 09:50:37 +0000 (10:50 +0100)
Silences MSVC warning.

llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp

index 2ddbfd2..5fb1cf6 100644 (file)
@@ -837,7 +837,7 @@ auto AlignVectors::realignGroup(const MoveGroup &Move) const -> bool {
 
     // Create an extra "undef" sector at the beginning and at the end.
     // They will be used as the left/right filler in the vlalign step.
-    for (int i = -DoAlign; i != NumSectors + DoAlign; ++i) {
+    for (int i = (DoAlign ? -1 : 0); i != NumSectors + DoAlign; ++i) {
       // For stores, the size of each section is an aligned vector length.
       // Adjust the store offsets relative to the section start offset.
       ByteSpan VSection = VSpan.section(i * ScLen, ScLen).shift(-i * ScLen);