Set NumSignBits to 1 if KnownZero/KnownOne are being zero extended. In theory it
authorCameron Zwarich <zwarich@apple.com>
Fri, 25 Feb 2011 01:11:01 +0000 (01:11 +0000)
committerCameron Zwarich <zwarich@apple.com>
Fri, 25 Feb 2011 01:11:01 +0000 (01:11 +0000)
is possible to do better if the high bit is set in either KnownZero/KnownOne, but
in practice NumSignBits is always 1 when we are zero extending because nothing
is known about that register.

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

lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp

index 3cab795baeb7d9a41d30bb5bd7c11796ab497b06..2ae3286829dd9bf1119bd2b8b76aaac982ef8801 100644 (file)
@@ -270,6 +270,7 @@ FunctionLoweringInfo::GetLiveOutRegInfo(unsigned Reg, unsigned BitWidth) {
     return NULL;
 
   if (BitWidth > LOI->KnownZero.getBitWidth()) {
+    LOI->NumSignBits = 1;
     LOI->KnownZero = LOI->KnownZero.zextOrTrunc(BitWidth);
     LOI->KnownOne = LOI->KnownOne.zextOrTrunc(BitWidth);
   }