llvm.org GIT mirror llvm / 6f43963
Reformat comment lines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274480 91177308-0d34-0410-b5e6-96231b3b80d8 NAKAMURA Takumi 4 years ago
2 changed file(s) with 9 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
6666 /// This Value has no known value yet. As a result, this implies the
6767 /// producing instruction is dead. Caution: We use this as the starting
6868 /// state in our local meet rules. In this usage, it's taken to mean
69 /// "nothing known yet".
69 /// "nothing known yet".
7070 undefined,
7171
7272 /// This Value has a specific constant value. (For integers, constantrange
317317 /// * This method does not promise to return the most precise possible lattice
318318 /// value implied by A and B. It is allowed to return any lattice element
319319 /// which is at least as strong as *either* A or B (unless our facts
320 /// conflict, see below).
320 /// conflict, see below).
321321 /// * Due to unreachable code, the intersection of two lattice values could be
322322 /// contradictory. If this happens, we return some valid lattice value so as
323323 /// not confuse the rest of LVI. Ideally, we'd always return Undefined, but
353353 A.getConstantRange().intersectWith(B.getConstantRange());
354354 // Note: An empty range is implicitly converted to overdefined internally.
355355 // TODO: We could instead use Undefined here since we've proven a conflict
356 // and thus know this path must be unreachable.
356 // and thus know this path must be unreachable.
357357 return LVILatticeVal::getRange(std::move(Range));
358358 }
359359
927927 case SPF_SMAX: /// Signed maximum
928928 BBLV.markConstantRange(TrueCR.smax(FalseCR));
929929 return true;
930 case SPF_UMAX: /// Unsigned maximum
930 case SPF_UMAX: /// Unsigned maximum
931931 BBLV.markConstantRange(TrueCR.umax(FalseCR));
932932 return true;
933933 };
959959 // %siv.next = select i1 %39, i32 16, i32 %40
960960 // %siv.next = constantrange<0, 17> not <-1, 17>
961961 // In general, this can handle any clamp idiom which tests the edge
962 // condition via an equality or inequality.
962 // condition via an equality or inequality.
963963 ICmpInst::Predicate Pred = ICI->getPredicate();
964964 Value *A = ICI->getOperand(0);
965965 if (ConstantInt *CIBase = dyn_cast(ICI->getOperand(1))) {
11711171 if (isa(ICI->getOperand(1))) {
11721172 if (ICI->isEquality() && ICI->getOperand(0) == Val) {
11731173 // We know that V has the RHS constant if this is a true SETEQ or
1174 // false SETNE.
1174 // false SETNE.
11751175 if (isTrueDest == (ICI->getPredicate() == ICmpInst::ICMP_EQ))
11761176 Result = LVILatticeVal::get(cast(ICI->getOperand(1)));
11771177 else
16401640 // We limit the search to one step backwards from the current BB and value.
16411641 // We could consider extending this to search further backwards through the
16421642 // CFG and/or value graph, but there are non-obvious compile time vs quality
1643 // tradeoffs.
1643 // tradeoffs.
16441644 if (CxtI) {
16451645 BasicBlock *BB = CxtI->getParent();
16461646
16601660 for (unsigned i = 0, e = PHI->getNumIncomingValues(); i < e; i++) {
16611661 Value *Incoming = PHI->getIncomingValue(i);
16621662 BasicBlock *PredBB = PHI->getIncomingBlock(i);
1663 // Note that PredBB may be BB itself.
1663 // Note that PredBB may be BB itself.
16641664 Tristate Result = getPredicateOnEdge(Pred, Incoming, C, PredBB, BB,
16651665 CxtI);
16661666
357357 const coff_section *CoffSection = COFFObj->getCOFFSection(Section);
358358 // Avoid loading zero-sized COFF sections.
359359 // In PE files, VirtualSize gives the section size, and SizeOfRawData
360 // may be zero for sections with content. In Obj files, SizeOfRawData
360 // 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.
363363 bool HasContent =