Mark more constants unsigned, as warned about by icc (#68).
authorDuncan Sands <baldrick@free.fr>
Sun, 6 Sep 2009 12:56:52 +0000 (12:56 +0000)
committerDuncan Sands <baldrick@free.fr>
Sun, 6 Sep 2009 12:56:52 +0000 (12:56 +0000)
Patch by Erick Tryzelaar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81116 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineConstantPool.h
include/llvm/Support/PatternMatch.h
lib/Analysis/ProfileInfoLoader.cpp
lib/CodeGen/PBQP/Heuristics/Briggs.h
lib/Target/X86/X86RegisterInfo.cpp

index 59d8e635261e242eb3e2beeaf3d24378138a4ab3..8d6c1d1e4ca2c0f088ef981e8fb051aee0fe57da 100644 (file)
@@ -89,7 +89,7 @@ public:
   MachineConstantPoolEntry(MachineConstantPoolValue *V, unsigned A)
     : Alignment(A) {
     Val.MachineCPVal = V; 
-    Alignment |= 1 << (sizeof(unsigned)*CHAR_BIT-1);
+    Alignment |= 1U << (sizeof(unsigned)*CHAR_BIT-1);
   }
 
   bool isMachineConstantPoolEntry() const {
index f085b0ff510faef3f9ba59b5cce412a6312c8a66..eb393ac4c3eba638fd18cecfb2ca657cefcec783 100644 (file)
@@ -58,7 +58,7 @@ struct constantint_ty {
     if (const ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
       const APInt &CIV = CI->getValue();
       if (Val >= 0)
-        return CIV == Val;
+        return CIV == static_cast<uint64_t>(Val);
       // If Val is negative, and CI is shorter than it, truncate to the right
       // number of bits.  If it is larger, then we have to sign extend.  Just
       // compare their negated values.
index cb7ae1a10c3a92ade0723ae5b882ba2b87794201..a6c55dfd5f7a6e45f17e322627ef8f32acc52236 100644 (file)
@@ -26,10 +26,10 @@ using namespace llvm;
 //
 static inline unsigned ByteSwap(unsigned Var, bool Really) {
   if (!Really) return Var;
-  return ((Var & (255<< 0)) << 24) |
-         ((Var & (255<< 8)) <<  8) |
-         ((Var & (255<<16)) >>  8) |
-         ((Var & (255<<24)) >> 24);
+  return ((Var & (255U<< 0U)) << 24U) |
+         ((Var & (255U<< 8U)) <<  8U) |
+         ((Var & (255U<<16U)) >>  8U) |
+         ((Var & (255U<<24U)) >> 24U);
 }
 
 static unsigned AddCounts(unsigned A, unsigned B) {
index 255ffef529d97275c8c8499b5ff7e85dcc2bc0ba..3ac9e707bab46a5cbad14133e7071f4f5dca36d9 100644 (file)
@@ -118,7 +118,7 @@ class Briggs {
 
           if (!add) {
             udTarget = 1;
-            dir = -1;
+            dir = ~0;
           }
 
           EdgeData &linkEdgeData = g.getEdgeData(edgeItr).getHeuristicData();
index 76d2b97bf9f78d14b4f0b98a81f6e60edb3b0261..64bd97e265e202ca63e46cf21f05875e9dfc41d9 100644 (file)
@@ -645,7 +645,7 @@ X86RegisterInfo::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
     //   }
     //   [EBP]
     MFI->CreateFixedObject(-TailCallReturnAddrDelta,
-                           (-1*SlotSize)+TailCallReturnAddrDelta);
+                           (-1U*SlotSize)+TailCallReturnAddrDelta);
   }
 
   if (hasFP(MF)) {