Changes in directory llvm/lib/Support:

APInt.cpp updated: 1.79 -> 1.79.2.1
---
Log message:

Merge from mainline.



---
Diffs of the changes:  (+6 -0)

 APInt.cpp |    6 ++++++
 1 files changed, 6 insertions(+)


Index: llvm/lib/Support/APInt.cpp
diff -u llvm/lib/Support/APInt.cpp:1.79 llvm/lib/Support/APInt.cpp:1.79.2.1
--- llvm/lib/Support/APInt.cpp:1.79     Thu May  3 13:15:36 2007
+++ llvm/lib/Support/APInt.cpp  Tue May 15 00:00:54 2007
@@ -1199,6 +1199,12 @@
   if (shiftAmt == BitWidth)
     return APInt(BitWidth, 0);
 
+  // If none of the bits are shifted out, the result is *this. This avoids a
+  // lshr by the words size in the loop below which can produce incorrect
+  // results. It also avoids the expensive computation below for a common case.
+  if (shiftAmt == 0)
+    return *this;
+
   // Create some space for the result.
   uint64_t * val = new uint64_t[getNumWords()];
 



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to