Lines Matching +full:left +full:- +full:shifted
1 //===- HexagonOptimizeSZextends.cpp - Remove unnecessary argument extends -===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
80 SExtInst* SI = new SExtInst(&Arg, Use->getType()); in runOnFunction()
81 assert (EVT::getEVT(SI->getType()) == in runOnFunction()
82 (EVT::getEVT(Use->getType()))); in runOnFunction()
83 Use->replaceAllUsesWith(SI); in runOnFunction()
85 SI->insertBefore(First); in runOnFunction()
86 Use->eraseFromParent(); in runOnFunction()
104 if (!(Ashr && Ashr->getOpcode() == Instruction::AShr)) in runOnFunction()
106 Value *AshrOp1 = Ashr->getOperand(1); in runOnFunction()
108 // Right shifted by 16. in runOnFunction()
109 if (!(C && C->getSExtValue() == 16)) in runOnFunction()
112 // The first operand of Ashr comes from logical shift left. in runOnFunction()
113 Instruction *Shl = dyn_cast<Instruction>(Ashr->getOperand(0)); in runOnFunction()
114 if (!(Shl && Shl->getOpcode() == Instruction::Shl)) in runOnFunction()
116 Value *Intr = Shl->getOperand(0); in runOnFunction()
117 Value *ShlOp1 = Shl->getOperand(1); in runOnFunction()
119 // Left shifted by 16. in runOnFunction()
120 if (!(C && C->getSExtValue() == 16)) in runOnFunction()
125 if (!intrinsicAlreadySextended(I->getIntrinsicID())) in runOnFunction()
128 for (auto UI = Ashr->user_begin(), UE = Ashr->user_end(); in runOnFunction()
132 J->replaceUsesOfWith(Ashr, I); in runOnFunction()