llvm.org GIT mirror llvm / 28bebe4
[DemandedBits] fix formatting; NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307403 91177308-0d34-0410-b5e6-96231b3b80d8 Sanjay Patel 3 years ago
1 changed file(s) with 6 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
142142 break;
143143 case Instruction::Shl:
144144 if (OperandNo == 0)
145 if (ConstantInt *CI =
146 dyn_cast(UserI->getOperand(1))) {
147 uint64_t ShiftAmt = CI->getLimitedValue(BitWidth-1);
145 if (auto *ShiftAmtC = dyn_cast(UserI->getOperand(1))) {
146 uint64_t ShiftAmt = ShiftAmtC->getLimitedValue(BitWidth - 1);
148147 AB = AOut.lshr(ShiftAmt);
149148
150149 // If the shift is nuw/nsw, then the high bits are not dead
158157 break;
159158 case Instruction::LShr:
160159 if (OperandNo == 0)
161 if (ConstantInt *CI =
162 dyn_cast(UserI->getOperand(1))) {
163 uint64_t ShiftAmt = CI->getLimitedValue(BitWidth-1);
160 if (auto *ShiftAmtC = dyn_cast(UserI->getOperand(1))) {
161 uint64_t ShiftAmt = ShiftAmtC->getLimitedValue(BitWidth - 1);
164162 AB = AOut.shl(ShiftAmt);
165163
166164 // If the shift is exact, then the low bits are not dead
171169 break;
172170 case Instruction::AShr:
173171 if (OperandNo == 0)
174 if (ConstantInt *CI =
175 dyn_cast(UserI->getOperand(1))) {
176 uint64_t ShiftAmt = CI->getLimitedValue(BitWidth-1);
172 if (auto *ShiftAmtC = dyn_cast(UserI->getOperand(1))) {
173 uint64_t ShiftAmt = ShiftAmtC->getLimitedValue(BitWidth - 1);
177174 AB = AOut.shl(ShiftAmt);
178175 // Because the high input bit is replicated into the
179176 // high-order bits of the result, if we need any of those