Lines Matching +full:x +full:- +full:gene

1 //===- HexagonGenExtract.cpp ----------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
33 static cl::opt<unsigned> ExtractCutoff("extract-cutoff", cl::init(~0U),
38 // One of the reasons for "extract" is to put a sequence of bits in a regis-
40 // "insert"). If the bits are already at offset 0, it is better not to gene-
43 static cl::opt<bool> NoSR0("extract-nosr0", cl::init(true), cl::Hidden,
46 static cl::opt<bool> NeedAnd("extract-needand", cl::init(true), cl::Hidden,
101 BasicBlock *BB = In->getParent(); in INITIALIZE_PASS_DEPENDENCY()
102 LLVMContext &Ctx = BB->getContext(); in INITIALIZE_PASS_DEPENDENCY()
105 // (and (shl (lshr x, #sr), #sl), #m) in INITIALIZE_PASS_DEPENDENCY()
112 // (and (shl (ashr x, #sr), #sl), #m) in INITIALIZE_PASS_DEPENDENCY()
119 // (and (shl x, #sl), #m) in INITIALIZE_PASS_DEPENDENCY()
128 // (and (lshr x, #sr), #m) in INITIALIZE_PASS_DEPENDENCY()
135 // (and (ashr x, #sr), #m) in INITIALIZE_PASS_DEPENDENCY()
143 // (shl (lshr x, #sr), #sl) in INITIALIZE_PASS_DEPENDENCY()
150 // (shl (ashr x, #sr), #sl) in INITIALIZE_PASS_DEPENDENCY()
158 Type *Ty = BF->getType(); in INITIALIZE_PASS_DEPENDENCY()
159 if (!Ty->isIntegerTy()) in INITIALIZE_PASS_DEPENDENCY()
161 unsigned BW = Ty->getPrimitiveSizeInBits(); in INITIALIZE_PASS_DEPENDENCY()
165 uint32_t SR = CSR->getZExtValue(); in INITIALIZE_PASS_DEPENDENCY()
166 uint32_t SL = CSL->getZExtValue(); in INITIALIZE_PASS_DEPENDENCY()
178 // CM is the shifted-left mask. Shift it back right to remove the zero in INITIALIZE_PASS_DEPENDENCY()
179 // bits on least-significant positions. in INITIALIZE_PASS_DEPENDENCY()
180 APInt M = CM->getValue().lshr(SL); in INITIALIZE_PASS_DEPENDENCY()
185 uint32_t U = BW - std::max(SL, SR); in INITIALIZE_PASS_DEPENDENCY()
193 // and-ed with. The extract operation will copy these bits, and so the in INITIALIZE_PASS_DEPENDENCY()
200 APInt C = APInt::getHighBitsSet(BW, BW-U); in INITIALIZE_PASS_DEPENDENCY()
214 Module *Mod = BB->getParent()->getParent(); in INITIALIZE_PASS_DEPENDENCY()
218 NewIn = IRB.CreateShl(NewIn, SL, CSL->getName()); in INITIALIZE_PASS_DEPENDENCY()
219 In->replaceAllUsesWith(NewIn); in INITIALIZE_PASS_DEPENDENCY()
226 // Depth-first, bottom-up traversal. in visitBlock()
227 for (auto *DTN : children<DomTreeNode*>(DT->getNode(B))) in visitBlock()
228 Changed |= visitBlock(DTN->getBlock()); in visitBlock()
234 BasicBlock::iterator I = std::prev(B->end()), NextI, Begin = B->begin(); in visitBlock()
260 // Traverse the function bottom-up, to see super-expressions before their in runOnFunction()
261 // sub-expressions. in runOnFunction()