llvm.org GIT mirror llvm / 7810e66
Reformat. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274478 91177308-0d34-0410-b5e6-96231b3b80d8 NAKAMURA Takumi 4 years ago
2 changed file(s) with 30 addition(s) and 32 deletion(s). Raw diff Collapse all Expand all
440440 lookup(Val)[BB] = Result;
441441 }
442442
443 LVILatticeVal getBlockValue(Value *Val, BasicBlock *BB);
444 bool getEdgeValue(Value *V, BasicBlock *F, BasicBlock *T,
445 LVILatticeVal &Result,
446 Instruction *CxtI = nullptr);
447 bool hasBlockValue(Value *Val, BasicBlock *BB);
448
449 // These methods process one work item and may add more. A false value
450 // returned means that the work item was not completely processed and must
451 // be revisited after going through the new items.
452 bool solveBlockValue(Value *Val, BasicBlock *BB);
453 bool solveBlockValueNonLocal(LVILatticeVal &BBLV,
454 Value *Val, BasicBlock *BB);
455 bool solveBlockValuePHINode(LVILatticeVal &BBLV,
456 PHINode *PN, BasicBlock *BB);
457 bool solveBlockValueSelect(LVILatticeVal &BBLV,
458 SelectInst *S, BasicBlock *BB);
459 bool solveBlockValueBinaryOp(LVILatticeVal &BBLV,
460 Instruction *BBI, BasicBlock *BB);
461 bool solveBlockValueCast(LVILatticeVal &BBLV,
462 Instruction *BBI, BasicBlock *BB);
463 void intersectAssumeBlockValueConstantRange(Value *Val, LVILatticeVal &BBLV,
464 Instruction *BBI);
465
466 void solve();
467
468 ValueCacheEntryTy &lookup(Value *V) {
469 return ValueCache[LVIValueHandle(V, this)];
470 }
443 LVILatticeVal getBlockValue(Value *Val, BasicBlock *BB);
444 bool getEdgeValue(Value *V, BasicBlock *F, BasicBlock *T,
445 LVILatticeVal &Result, Instruction *CxtI = nullptr);
446 bool hasBlockValue(Value *Val, BasicBlock *BB);
447
448 // These methods process one work item and may add more. A false value
449 // returned means that the work item was not completely processed and must
450 // be revisited after going through the new items.
451 bool solveBlockValue(Value *Val, BasicBlock *BB);
452 bool solveBlockValueNonLocal(LVILatticeVal &BBLV, Value *Val, BasicBlock *BB);
453 bool solveBlockValuePHINode(LVILatticeVal &BBLV, PHINode *PN, BasicBlock *BB);
454 bool solveBlockValueSelect(LVILatticeVal &BBLV, SelectInst *S,
455 BasicBlock *BB);
456 bool solveBlockValueBinaryOp(LVILatticeVal &BBLV, Instruction *BBI,
457 BasicBlock *BB);
458 bool solveBlockValueCast(LVILatticeVal &BBLV, Instruction *BBI,
459 BasicBlock *BB);
460 void intersectAssumeBlockValueConstantRange(Value *Val, LVILatticeVal &BBLV,
461 Instruction *BBI);
462
463 void solve();
464
465 ValueCacheEntryTy &lookup(Value *V) {
466 return ValueCache[LVIValueHandle(V, this)];
467 }
471468
472469 bool isOverdefined(Value *V, BasicBlock *BB) const {
473470 auto ODI = OverDefinedCache.find(BB);
360360 // may be zero for sections with content. In Obj files, SizeOfRawData
361361 // gives the section size, and VirtualSize is always zero. Hence
362362 // the need to check for both cases below.
363 bool HasContent = (CoffSection->VirtualSize > 0)
364 || (CoffSection->SizeOfRawData > 0);
365 bool IsDiscardable = CoffSection->Characteristics &
366 (COFF::IMAGE_SCN_MEM_DISCARDABLE | COFF::IMAGE_SCN_LNK_INFO);
363 bool HasContent =
364 (CoffSection->VirtualSize > 0) || (CoffSection->SizeOfRawData > 0);
365 bool IsDiscardable =
366 CoffSection->Characteristics &
367 (COFF::IMAGE_SCN_MEM_DISCARDABLE | COFF::IMAGE_SCN_LNK_INFO);
367368 return HasContent && !IsDiscardable;
368369 }
369370