Lines Matching refs:Instr
102 Inst *Instr = nullptr;
140 static BoolFoldingProducerKind getProducerKind(const Inst *Instr);
141 static BoolFoldingConsumerKind getConsumerKind(const Inst *Instr);
142 static bool hasComplexLowering(const Inst *Instr);
153 return Element != Producers.end() && Element->second.Instr != nullptr;
155 void setInvalid(SizeT VarNum) { Producers[VarNum].Instr = nullptr; }
156 void invalidateProducersOnStore(const Inst *Instr);
163 : Instr(I), IsComplex(BoolFolding<Traits>::hasComplexLowering(I)) {}
167 BoolFolding<Traits>::getProducerKind(const Inst *Instr) {
168 if (llvm::isa<InstIcmp>(Instr)) {
169 if (Traits::Is64Bit || Instr->getSrc(0)->getType() != IceType_i64)
173 if (llvm::isa<InstFcmp>(Instr))
175 if (auto *Arith = llvm::dyn_cast<InstArithmetic>(Instr)) {
188 if (auto *Cast = llvm::dyn_cast<InstCast>(Instr)) {
201 BoolFolding<Traits>::getConsumerKind(const Inst *Instr) {
202 if (llvm::isa<InstBr>(Instr))
204 if (llvm::isa<InstSelect>(Instr))
208 if (auto *Cast = llvm::dyn_cast<InstCast>(Instr)) {
227 bool BoolFolding<Traits>::hasComplexLowering(const Inst *Instr) {
228 switch (getProducerKind(Instr)) {
234 return Traits::TableFcmp[llvm::cast<InstFcmp>(Instr)->getCondition()].C2 !=
257 for (Inst &Instr : Node->getInsts()) {
258 if (Instr.isDeleted())
260 invalidateProducersOnStore(&Instr);
262 Variable *Var = Instr.getDest();
265 if (getProducerKind(&Instr) != PK_None) { // white-listed instructions
266 Producers[Var->getIndex()] = BoolFoldingEntry<Traits>(&Instr);
271 FOREACH_VAR_IN_INST(Var, Instr) {
282 getConsumerKind(&Instr);
288 getProducerKind(Producers[VarNum].Instr);
299 if (Instr.isLastUse(Var)) {
306 if (I.second.Instr == nullptr)
317 I.second.Instr->setDead();
330 return Element->second.Instr;
340 if (I.second.Instr == nullptr)
343 I.second.Instr->dump(Func);
362 void BoolFolding<Traits>::invalidateProducersOnStore(const Inst *Instr) {
363 if (!Instr->isMemoryWrite())
368 Inst *PInst = ProducerPair.second.Instr;
1456 void TargetX86Base<TraitsType>::lowerAlloca(const InstAlloca *Instr) {
1467 const uint32_t AlignmentParam = std::max(1u, Instr->getAlignInBytes());
1477 const bool AllocaWithKnownOffset = Instr->getKnownFrameOffset();
1489 Variable *Dest = Instr->getDest();
1490 Operand *TotalSize = legalize(Instr->getSizeInBytes());
1924 void TargetX86Base<TraitsType>::lowerArithmetic(const InstArithmetic *Instr) {
1925 Variable *Dest = Instr->getDest();
1931 Operand *Src0 = legalize(Instr->getSrc(0));
1932 Operand *Src1 = legalize(Instr->getSrc(1));
1933 if (Instr->isCommutative()) {
1945 if (!Instr->isLastUse(Src0) && Instr->isLastUse(Src1)) {
1959 switch (Instr->getOp()) {
1977 switch (Instr->getOp()) {
2055 lowerShift64(Instr->getOp(), Src0Lo, Src0Hi, Src1Lo, DestLo, DestHi);
2079 switch (Instr->getOp()) {
2225 switch (Instr->getOp()) {
2232 auto *Const = llvm::dyn_cast<Constant>(Instr->getSrc(1));
2552 void TargetX86Base<TraitsType>::lowerAssign(const InstAssign *Instr) {
2553 Variable *Dest = Instr->getDest();
2558 Operand *Src = Instr->getSrc(0);
2605 void TargetX86Base<TraitsType>::lowerCall(const InstCall *Instr) {
2630 for (SizeT i = 0, NumArgs = Instr->getNumArgs(); i < NumArgs; ++i) {
2631 Operand *Arg = Instr->getArg(i);
2659 Variable *Dest = Instr->getDest();
2750 legalize(Instr->getCallTarget(), Legal_Reg | Legal_Imm | Legal_AddrAbs);
2770 if (Instr->hasSideEffects() && ReturnReg) {
2811 void TargetX86Base<TraitsType>::lowerCast(const InstCast *Instr) {
2813 InstCast::OpKind CastKind = Instr->getCastKind();
2814 Variable *Dest = Instr->getDest();
2827 Operand *Src0RM = legalize(Instr->getSrc(0), Legal_Reg | Legal_Mem);
2899 Operand *Src0RM = legalize(Instr->getSrc(0), Legal_Reg | Legal_Mem);
2946 Operand *Src0RM = legalize(Instr->getSrc(0), Legal_Reg | Legal_Mem);
2955 Operand *Src0 = legalizeUndef(Instr->getSrc(0));
2964 Operand *Src0 = legalizeUndef(Instr->getSrc(0));
2977 Operand *Src0RM = legalize(Instr->getSrc(0), Legal_Reg | Legal_Mem);
2987 assert(Instr->getSrc(0)->getType() == IceType_v4f32);
2988 Operand *Src0R = legalizeToReg(Instr->getSrc(0));
2995 Operand *Src0RM = legalize(Instr->getSrc(0), Legal_Reg | Legal_Mem);
3025 Operand *Src0RM = legalize(Instr->getSrc(0), Legal_Reg | Legal_Mem);
3051 assert(Instr->getSrc(0)->getType() == IceType_v4i32);
3052 Operand *Src0R = legalizeToReg(Instr->getSrc(0));
3056 } else if (!Traits::Is64Bit && Instr->getSrc(0)->getType() == IceType_i64) {
3059 Operand *Src0RM = legalize(Instr->getSrc(0), Legal_Reg | Legal_Mem);
3079 Operand *Src0 = Instr->getSrc(0);
3108 Operand *Src0 = Instr->getSrc(0);
3242 const InstExtractElement *Instr) {
3243 Operand *SourceVectNotLegalized = Instr->getSrc(0);
3244 auto *ElementIndex = llvm::dyn_cast<ConstantInteger32>(Instr->getSrc(1));
3317 Variable *Dest = Instr->getDest();
3905 const InstInsertElement *Instr) {
3906 Operand *SourceVectNotLegalized = Instr->getSrc(0);
3907 Operand *ElementToInsertNotLegalized = Instr->getSrc(1);
3908 auto *ElementIndex = llvm::dyn_cast<ConstantInteger32>(Instr->getSrc(2));
3953 _movp(Instr->getDest(), T);
3974 _movp(Instr->getDest(), T);
4008 _movp(Instr->getDest(), ElementR);
4014 _movp(Instr->getDest(), T);
4034 _movp(Instr->getDest(), T);
4040 const InstIntrinsicCall *Instr) {
4041 switch (Intrinsics::IntrinsicID ID = Instr->getIntrinsicInfo().ID) {
4044 ID, getConstantMemoryOrder(Instr->getArg(3)),
4045 getConstantMemoryOrder(Instr->getArg(4)))) {
4049 Variable *DestPrev = Instr->getDest();
4050 Operand *PtrToMem = legalize(Instr->getArg(0));
4051 Operand *Expected = legalize(Instr->getArg(1));
4052 Operand *Desired = legalize(Instr->getArg(2));
4060 ID, getConstantMemoryOrder(Instr->getArg(0)))) {
4076 Operand *ByteSize = Instr->getArg(0);
4077 Variable *Dest = Instr->getDest();
4106 ID, getConstantMemoryOrder(Instr->getArg(1)))) {
4110 Variable *Dest = Instr->getDest();
4119 X86OperandMem *Addr = formMemoryOperand(Instr->getArg(0), IceType_f64);
4130 auto *Load = InstLoad::create(Func, Dest, Instr->getArg(0));
4140 ID, getConstantMemoryOrder(Instr->getArg(3)))) {
4145 Instr->getDest(),
4147 llvm::cast<ConstantInteger32>(Instr->getArg(0))->getValue()),
4148 Instr->getArg(1), Instr->getArg(2));
4152 ID, getConstantMemoryOrder(Instr->getArg(2)))) {
4159 Operand *Value = Instr->getArg(0);
4160 Operand *Ptr = Instr->getArg(1);
4180 Variable *Dest = Instr->getDest();
4181 Operand *Val = Instr->getArg(0);
4211 Variable *Dest = Instr->getDest();
4213 Operand *Val = Instr->getArg(0);
4277 Operand *Val = legalize(Instr->getArg(0));
4287 lowerCountZeros(IsCttz, Val->getType(), Instr->getDest(), FirstVal,
4294 Operand *Val = legalize(Instr->getArg(0));
4304 lowerCountZeros(IsCttz, Val->getType(), Instr->getDest(), FirstVal,
4309 Operand *Src = legalize(Instr->getArg(0));
4311 Variable *Dest = Instr->getDest();
4330 Call->addArg(Instr->getArg(0));
4331 Call->addArg(Instr->getArg(1));
4336 lowerMemcpy(Instr->getArg(0), Instr->getArg(1), Instr->getArg(2));
4340 lowerMemmove(Instr->getArg(0), Instr->getArg(1), Instr->getArg(2));
4344 lowerMemset(Instr->getArg(0), Instr->getArg(1), Instr->getArg(2));
4351 Variable *Dest = Instr->getDest();
4357 makeHelperCall(RuntimeHelper::H_call_read_tp, Instr->getDest(), 0);
4364 makeHelperCall(RuntimeHelper::H_call_setjmp, Instr->getDest(), 1);
4365 Call->addArg(Instr->getArg(0));
4370 assert(isScalarFloatingType(Instr->getDest()->getType()) ||
4372 Operand *Src = legalize(Instr->getArg(0));
4373 Variable *Dest = Instr->getDest();
4383 Variable *Dest = Instr->getDest();
4389 Variable *Dest = Instr->getDest();
4395 Operand *Src = Instr->getArg(0);
4404 assert(llvm::isa<ConstantInteger32>(Instr->getArg(1)) &&
4406 Variable *Dest = Instr->getDest();
4408 auto *SubVectorSize = llvm::cast<ConstantInteger32>(Instr->getArg(1));
4409 Operand *Addr = Instr->getArg(0);
4434 assert(llvm::isa<ConstantInteger32>(Instr->getArg(2)) &&
4436 auto *SubVectorSize = llvm::cast<ConstantInteger32>(Instr->getArg(2));
4437 Operand *Value = Instr->getArg(0);
4438 Operand *Addr = Instr->getArg(1);
4458 Operand *Src0 = Instr->getArg(0);
4459 Operand *Src1 = Instr->getArg(1);
4460 Variable *Dest = Instr->getDest();
4470 Operand *Src0 = Instr->getArg(0);
4471 Operand *Src1 = Instr->getArg(1);
4472 Variable *Dest = Instr->getDest();
4482 Operand *SrcReg = legalizeToReg(Instr->getArg(0));
4483 Variable *Dest = Instr->getDest();
4497 Operand *Src0 = Instr->getArg(0);
4498 Operand *Src1 = Instr->getArg(1);
4499 Variable *Dest = Instr->getDest();
4509 Operand *Src0 = Instr->getArg(0);
4510 Operand *Src1 = Instr->getArg(1);
4511 Variable *Dest = Instr->getDest();
4521 Operand *Src0 = Instr->getArg(0);
4522 Operand *Src1 = Instr->getArg(1);
4523 Variable *Dest = Instr->getDest();
4533 Operand *Src0 = Instr->getArg(0);
4534 Operand *Src1 = Instr->getArg(1);
4535 Variable *Dest = Instr->getDest();
4545 Operand *Src0 = Instr->getArg(0);
4546 Operand *Src1 = Instr->getArg(1);
4547 Variable *Dest = Instr->getDest();
4557 Operand *Src0 = Instr->getArg(0);
4558 Operand *Src1 = Instr->getArg(1);
4559 Variable *Dest = Instr->getDest();
4569 Operand *Src0 = Instr->getArg(0);
4570 Operand *Src1 = Instr->getArg(1);
4571 Variable *Dest = Instr->getDest();
4581 Operand *Src = Instr->getArg(0);
4582 Variable *Dest = Instr->getDest();
4620 Variable *Dest = Instr->getDest();
4621 Operand *Src = Instr->getArg(0);
4622 Operand *Mode = Instr->getArg(1);
5392 static bool isAdd(const Inst *Instr) {
5393 if (auto *Arith = llvm::dyn_cast_or_null<const InstArithmetic>(Instr)) {
5729 TargetX86Base<TypeTraits>::computeAddressOpt(const Inst *Instr, Type MemType,
5736 Instr->dumpDecorated(Func);
5777 Reason = Instr;
5986 Inst *Instr = iteratorToInst(Context.getCur());
5988 if (auto *Icmp = llvm::dyn_cast<InstIcmp>(Instr)) {
6017 Inst *Instr = iteratorToInst(Context.getCur());
6018 Operand *Addr = Instr->getSrc(0);
6019 Variable *Dest = Instr->getDest();
6020 if (auto *OptAddr = computeAddressOpt(Instr, Dest->getType(), Addr)) {
6021 Instr->setDeleted();
6058 void TargetX86Base<TraitsType>::lowerRet(const InstRet *Instr) {
6060 if (Instr->hasRetValue()) {
6061 Operand *RetValue = legalize(Instr->getRetValue());
6243 const InstShuffleVector *Instr) {
6244 auto *Dest = Instr->getDest();
6246 auto *Src0 = Instr->getSrc(0);
6247 auto *Src1 = Instr->getSrc(1);
6258 assert(ExpectedNumElements == Instr->getNumIndexes());
6261 if (Instr->indexesAre(0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7)) {
6270 if (Instr->indexesAre(0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7,
6281 if (Instr->indexesAre(8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14,
6291 if (Instr->indexesAre(8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30,
6307 const SizeT Index0 = Instr->getIndexValue(0);
6308 const SizeT Index1 = Instr->getIndexValue(1);
6309 const SizeT Index2 = Instr->getIndexValue(2);
6310 const SizeT Index3 = Instr->getIndexValue(3);
6311 const SizeT Index4 = Instr->getIndexValue(4);
6312 const SizeT Index5 = Instr->getIndexValue(5);
6313 const SizeT Index6 = Instr->getIndexValue(6);
6314 const SizeT Index7 = Instr->getIndexValue(7);
6315 const SizeT Index8 = Instr->getIndexValue(8);
6316 const SizeT Index9 = Instr->getIndexValue(9);
6317 const SizeT Index10 = Instr->getIndexValue(10);
6318 const SizeT Index11 = Instr->getIndexValue(11);
6319 const SizeT Index12 = Instr->getIndexValue(12);
6320 const SizeT Index13 = Instr->getIndexValue(13);
6321 const SizeT Index14 = Instr->getIndexValue(14);
6322 const SizeT Index15 = Instr->getIndexValue(15);
6333 assert(ExpectedNumElements == Instr->getNumIndexes());
6336 if (Instr->indexesAre(0, 0, 1, 1, 2, 2, 3, 3)) {
6345 if (Instr->indexesAre(0, 8, 1, 9, 2, 10, 3, 11)) {
6355 if (Instr->indexesAre(4, 4, 5, 5, 6, 6, 7, 7)) {
6364 if (Instr->indexesAre(4, 12, 5, 13, 6, 14, 7, 15)) {
6379 const SizeT Index0 = Instr->getIndexValue(0);
6380 const SizeT Index1 = Instr->getIndexValue(1);
6381 const SizeT Index2 = Instr->getIndexValue(2);
6382 const SizeT Index3 = Instr->getIndexValue(3);
6383 const SizeT Index4 = Instr->getIndexValue(4);
6384 const SizeT Index5 = Instr->getIndexValue(5);
6385 const SizeT Index6 = Instr->getIndexValue(6);
6386 const SizeT Index7 = Instr->getIndexValue(7);
6405 assert(ExpectedNumElements == Instr->getNumIndexes());
6406 const SizeT Index0 = Instr->getIndexValue(0);
6407 const SizeT Index1 = Instr->getIndexValue(1);
6408 const SizeT Index2 = Instr->getIndexValue(2);
6409 const SizeT Index3 = Instr->getIndexValue(3);
6605 for (SizeT I = 0; I < Instr->getNumIndexes(); ++I) {
6606 auto *Index = Instr->getIndex(I);
6815 void TargetX86Base<TraitsType>::lowerSelectVector(const InstSelect *Instr) {
6816 Variable *Dest = Instr->getDest();
6818 Operand *SrcT = Instr->getTrueOperand();
6819 Operand *SrcF = Instr->getFalseOperand();
6820 Operand *Condition = Instr->getCondition();
6884 void TargetX86Base<TraitsType>::lowerStore(const InstStore *Instr) {
6885 Operand *Value = Instr->getData();
6886 Operand *Addr = Instr->getAddr();
6907 auto *Instr = llvm::cast<InstStore>(Context.getCur());
6908 Operand *Addr = Instr->getAddr();
6909 Operand *Data = Instr->getData();
6910 if (auto *OptAddr = computeAddressOpt(Instr, Data->getType(), Addr)) {
6911 Instr->setDeleted();
6913 if (Instr->getDest())
6914 NewStore->setRmwBeacon(Instr->getRmwBeacon());
7051 void TargetX86Base<TraitsType>::lowerSwitch(const InstSwitch *Instr) {
7053 CaseClusterArray CaseClusters = CaseCluster::clusterizeSwitch(Func, Instr);
7054 Operand *Src0 = Instr->getComparison();
7055 CfgNode *DefaultTarget = Instr->getLabelDefault();
7066 SizeT NumCases = Instr->getNumCases();
7075 Constant *ValueLo = Ctx->getConstantInt32(Instr->getValue(I));
7076 Constant *ValueHi = Ctx->getConstantInt32(Instr->getValue(I) >> 32);
7081 _br(Traits::Cond::Br_e, Instr->getLabel(I));
7084 _br(Instr->getLabelDefault());
7302 void TargetX86Base<TraitsType>::lowerOther(const Inst *Instr) {
7303 if (const auto *RMW = llvm::dyn_cast<InstX86FakeRMW>(Instr)) {
7306 TargetLowering::lowerOther(Instr);
7351 void TargetX86Base<TraitsType>::genTargetHelperCallFor(Inst *Instr) {
7353 if (auto *Arith = llvm::dyn_cast<InstArithmetic>(Instr)) {
7420 } else if (auto *Cast = llvm::dyn_cast<InstCast>(Instr)) {
7538 } else if (auto *Intrinsic = llvm::dyn_cast<InstIntrinsicCall>(Instr)) {
7578 } else if (auto *Call = llvm::dyn_cast<InstCall>(Instr)) {
7580 } else if (auto *Ret = llvm::dyn_cast<InstRet>(Instr)) {
7635 const InstCall *Instr) {
7637 const SizeT NumArgs = Instr->getNumArgs();
7641 Operand *Arg = Instr->getArg(i);
7646 Variable *Dest = Instr->getDest();