[llvm] ea64200 - HexagonVectorCombine.cpp - don't negate a bool value. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon May 10 02:51:01 PDT 2021


Author: Simon Pilgrim
Date: 2021-05-10T10:50:37+01:00
New Revision: ea64200b6197d8db97a11db15a5906fc1eb5ef4a

URL: https://github.com/llvm/llvm-project/commit/ea64200b6197d8db97a11db15a5906fc1eb5ef4a
DIFF: https://github.com/llvm/llvm-project/commit/ea64200b6197d8db97a11db15a5906fc1eb5ef4a.diff

LOG: HexagonVectorCombine.cpp - don't negate a bool value. NFCI.

Silences MSVC warning.

Added: 
    

Modified: 
    llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp b/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp
index 2ddbfd2657948..5fb1cf690f19b 100644
--- a/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp
@@ -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);


        


More information about the llvm-commits mailing list