Skip to content

Commit

Permalink
Merged master:179c80117c9 into amd-gfx:ea6f2908759
Browse files Browse the repository at this point in the history
Local branch amd-gfx ea6f290 Merged master:51a276c759c into amd-gfx:a442e1e9af7
Remote branch master 179c801 [LoopUnroll] Remove dead NextBlocks argument (NFC).
  • Loading branch information
Sw authored and Sw committed May 25, 2020
2 parents ea6f290 + 179c801 commit 418304c
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 27 deletions.
4 changes: 4 additions & 0 deletions libcxx/include/cmath
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ floating_point trunc (arithmetic x);
float truncf(float x);
long double truncl(long double x);
constexpr float lerp(float a, float b, float t) noexcept; // C++20
constexpr double lerp(double a, double b, double t) noexcept; // C++20
constexpr long double lerp(long double a, long double b, long double t) noexcept; // C++20
} // std
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// <cmath>

// constexpr float lerp(float a, float b, float t);
// constexpr double lerp(double a, double b, double t);
// constexpr long double lerp(long double a, long double b, long double t);

// constexpr float lerp(float a, float b, float t) noexcept;
// constexpr double lerp(double a, double b, double t) noexcept;
// constexpr long double lerp(long double a, long double b, long double t) noexcept;

#include <cmath>
#include <limits>
Expand Down
2 changes: 1 addition & 1 deletion libcxx/www/cxx2a_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ <h3>Library Working group Issues Status</h3>
<tr><td><a href="https://wg21.link/LWG3175">3175</a></td><td>The <tt>CommonReference</tt> requirement of concept <tt>SwappableWith</tt> is not satisfied in the example</td><td>Prague</td><td></td></tr>
<tr><td><a href="https://wg21.link/LWG3194">3194</a></td><td><tt>ConvertibleTo</tt> prose does not match code</td><td>Prague</td><td></td></tr>
<tr><td><a href="https://wg21.link/LWG3200">3200</a></td><td><tt>midpoint</tt> should not constrain <tt>T</tt> is complete</td><td>Prague</td><td></td></tr>
<tr><td><a href="https://wg21.link/LWG3201">3201</a></td><td><tt>lerp</tt> should be marked as <tt>noexcept</tt></td><td>Prague</td><td></td></tr>
<tr><td><a href="https://wg21.link/LWG3201">3201</a></td><td><tt>lerp</tt> should be marked as <tt>noexcept</tt></td><td>Prague</td><td>Complete</td></tr>
<tr><td><a href="https://wg21.link/LWG3226">3226</a></td><td><tt>zoned_time</tt> constructor from <tt>string_view</tt> should accept <tt>zoned_time&lt;Duration2, TimeZonePtr2&gt;</tt></td><td>Prague</td><td></td></tr>
<tr><td><a href="https://wg21.link/LWG3233">3233</a></td><td>Broken requirements for <tt>shared_ptr</tt> converting constructors</td><td>Prague</td><td></td></tr>
<tr><td><a href="https://wg21.link/LWG3237">3237</a></td><td>LWG 3038 and 3190 have inconsistent PRs</td><td>Prague</td><td></td></tr>
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/Transforms/Utils/CallGraphUpdater.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace llvm {
class CallGraphUpdater {
/// Containers for functions which we did replace or want to delete when
/// `finalize` is called. This can happen explicitly or as part of the
/// destructor. Dead functions in comdat sections are tracked seperatly
/// destructor. Dead functions in comdat sections are tracked separately
/// because a function with discardable linakage in a COMDAT should only
/// be dropped if the entire COMDAT is dropped, see git ac07703842cf.
///{
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/IPO/AttributorAttributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ STATISTIC(NumAAs, "Number of abstract attributes created");
// }
// If there is a single "increment" side one can use the macro
// STATS_DECLTRACK with a custom message. If there are multiple increment
// sides, STATS_DECL and STATS_TRACK can also be used separatly.
// sides, STATS_DECL and STATS_TRACK can also be used separately.
//
#define BUILD_STAT_MSG_IR_ATTR(TYPE, NAME) \
("Number of " #TYPE " marked '" #NAME "'")
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/IPO/OpenMPOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ struct OpenMPOpt {
OMPRTL_omp_get_partition_num_places,
OMPRTL_omp_get_partition_place_nums};

// Global-tid is handled separatly.
// Global-tid is handled separately.
SmallSetVector<Value *, 16> GTIdArgs;
collectGlobalThreadIdArguments(GTIdArgs);
LLVM_DEBUG(dbgs() << TAG << "Found " << GTIdArgs.size()
Expand Down Expand Up @@ -556,7 +556,7 @@ struct OpenMPOpt {
auto &ORE = OREGetter(F);

ORE.emit([&]() {
return RemarkCB(RemarkKind(DEBUG_TYPE, RemarkName, Inst));
return RemarkCB(RemarkKind(DEBUG_TYPE, RemarkName, Inst));
});
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Instrumentation/PoisonChecking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ static void generateCreationChecks(Instruction &I,
if (isa<BinaryOperator>(I) && !I.getType()->isVectorTy())
generateCreationChecksForBinOp(I, Checks);

// Handle non-binops seperately
// Handle non-binops separately
switch (I.getOpcode()) {
default:
// Note there are a couple of missing cases here, once implemented, this
Expand Down
26 changes: 13 additions & 13 deletions llvm/lib/Transforms/Scalar/LoopPredication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class LoopPredication {
/// Return an insertion point suitable for inserting a safe to speculate
/// instruction whose only user will be 'User' which has operands 'Ops'. A
/// trivial result would be the at the User itself, but we try to return a
/// loop invariant location if possible.
/// loop invariant location if possible.
Instruction *findInsertPt(Instruction *User, ArrayRef<Value*> Ops);
/// Same as above, *except* that this uses the SCEV definition of invariant
/// which is that an expression *can be made* invariant via SCEVExpander.
Expand All @@ -278,7 +278,7 @@ class LoopPredication {

/// Return true if the value is known to produce a single fixed value across
/// all iterations on which it executes. Note that this does not imply
/// speculation safety. That must be established seperately.
/// speculation safety. That must be established separately.
bool isLoopInvariantValue(const SCEV* S);

Value *expandCheck(SCEVExpander &Expander, Instruction *Guard,
Expand Down Expand Up @@ -398,7 +398,7 @@ LoopPredication::parseLoopICmp(ICmpInst *ICI) {
}

Value *LoopPredication::expandCheck(SCEVExpander &Expander,
Instruction *Guard,
Instruction *Guard,
ICmpInst::Predicate Pred, const SCEV *LHS,
const SCEV *RHS) {
Type *Ty = LHS->getType();
Expand Down Expand Up @@ -522,7 +522,7 @@ Instruction *LoopPredication::findInsertPt(Instruction *Use,
return Preheader->getTerminator();
}

bool LoopPredication::isLoopInvariantValue(const SCEV* S) {
bool LoopPredication::isLoopInvariantValue(const SCEV* S) {
// Handling expressions which produce invariant results, but *haven't* yet
// been removed from the loop serves two important purposes.
// 1) Most importantly, it resolves a pass ordering cycle which would
Expand All @@ -535,20 +535,20 @@ bool LoopPredication::isLoopInvariantValue(const SCEV* S) {
// much more obviously in the IR. Otherwise, the cost modeling for other
// transforms would end up needing to duplicate all of this logic to model a
// check which becomes predictable based on a modeled peel or unswitch.
//
//
// The cost of doing so in the worst case is an extra fill from the stack in
// the loop to materialize the loop invariant test value instead of checking
// against the original IV which is presumable in a register inside the loop.
// Such cases are presumably rare, and hint at missing oppurtunities for
// other passes.
// other passes.

if (SE->isLoopInvariant(S, L))
// Note: This the SCEV variant, so the original Value* may be within the
// loop even though SCEV has proven it is loop invariant.
return true;

// Handle a particular important case which SCEV doesn't yet know about which
// shows up in range checks on arrays with immutable lengths.
// shows up in range checks on arrays with immutable lengths.
// TODO: This should be sunk inside SCEV.
if (const SCEVUnknown *U = dyn_cast<SCEVUnknown>(S))
if (const auto *LI = dyn_cast<LoadInst>(U->getValue()))
Expand All @@ -575,7 +575,7 @@ Optional<Value *> LoopPredication::widenICmpRangeCheckIncrementingLoop(
const SCEV *LatchLimit = LatchCheck.Limit;
// Subtlety: We need all the values to be *invariant* across all iterations,
// but we only need to check expansion safety for those which *aren't*
// already guaranteed to dominate the guard.
// already guaranteed to dominate the guard.
if (!isLoopInvariantValue(GuardStart) ||
!isLoopInvariantValue(GuardLimit) ||
!isLoopInvariantValue(LatchStart) ||
Expand All @@ -599,7 +599,7 @@ Optional<Value *> LoopPredication::widenICmpRangeCheckIncrementingLoop(
LLVM_DEBUG(dbgs() << "LHS: " << *LatchLimit << "\n");
LLVM_DEBUG(dbgs() << "RHS: " << *RHS << "\n");
LLVM_DEBUG(dbgs() << "Pred: " << LimitCheckPred << "\n");

auto *LimitCheck =
expandCheck(Expander, Guard, LimitCheckPred, LatchLimit, RHS);
auto *FirstIterationCheck = expandCheck(Expander, Guard, RangeCheck.Pred,
Expand All @@ -618,7 +618,7 @@ Optional<Value *> LoopPredication::widenICmpRangeCheckDecrementingLoop(
const SCEV *LatchLimit = LatchCheck.Limit;
// Subtlety: We need all the values to be *invariant* across all iterations,
// but we only need to check expansion safety for those which *aren't*
// already guaranteed to dominate the guard.
// already guaranteed to dominate the guard.
if (!isLoopInvariantValue(GuardStart) ||
!isLoopInvariantValue(GuardLimit) ||
!isLoopInvariantValue(LatchStart) ||
Expand Down Expand Up @@ -659,7 +659,7 @@ Optional<Value *> LoopPredication::widenICmpRangeCheckDecrementingLoop(
static void normalizePredicate(ScalarEvolution *SE, Loop *L,
LoopICmp& RC) {
// LFTR canonicalizes checks to the ICMP_NE/EQ form; normalize back to the
// ULT/UGE form for ease of handling by our caller.
// ULT/UGE form for ease of handling by our caller.
if (ICmpInst::isEquality(RC.Pred) &&
RC.IV->getStepRecurrence(*SE)->isOne() &&
SE->isKnownPredicate(ICmpInst::ICMP_ULE, RC.IV->getStart(), RC.Limit))
Expand Down Expand Up @@ -1044,7 +1044,7 @@ bool LoopPredication::predicateLoopExits(Loop *L, SCEVExpander &Rewriter) {
// inserting a branch on the value which can be either poison or undef. In
// this case, the branch can legally go either way; we just need to avoid
// introducing UB. This is achieved through the use of the freeze
// instruction.
// instruction.

SmallVector<BasicBlock *, 16> ExitingBlocks;
L->getExitingBlocks(ExitingBlocks);
Expand Down Expand Up @@ -1072,7 +1072,7 @@ bool LoopPredication::predicateLoopExits(Loop *L, SCEVExpander &Rewriter) {
// analyzeable after dropping widenability.
{
bool Invalidate = false;

for (auto *ExitingBB : ExitingBlocks) {
if (LI->getLoopFor(ExitingBB) != L)
continue;
Expand Down
5 changes: 2 additions & 3 deletions llvm/lib/Transforms/Utils/LoopUnroll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,6 @@ LoopUnrollResult llvm::UnrollLoop(Loop *L, UnrollLoopOptions ULO, LoopInfo *LI,
}

auto setDest = [LoopExit, ContinueOnTrue](BasicBlock *Src, BasicBlock *Dest,
ArrayRef<BasicBlock *> NextBlocks,
BasicBlock *BlockInLoop,
bool NeedConditional) {
auto *Term = cast<BranchInst>(Src->getTerminator());
Expand Down Expand Up @@ -779,7 +778,7 @@ LoopUnrollResult llvm::UnrollLoop(Loop *L, UnrollLoopOptions ULO, LoopInfo *LI,
NeedConditional = false;
}

setDest(Latches[i], Dest, Headers, Headers[i], NeedConditional);
setDest(Latches[i], Dest, Headers[i], NeedConditional);
}
} else {
// Setup headers to branch to their new successors in the unrolled
Expand All @@ -803,7 +802,7 @@ LoopUnrollResult llvm::UnrollLoop(Loop *L, UnrollLoopOptions ULO, LoopInfo *LI,
// unconditional branch for some iterations.
NeedConditional = false;

setDest(Headers[i], Dest, Headers, HeaderSucc[i], NeedConditional);
setDest(Headers[i], Dest, HeaderSucc[i], NeedConditional);
}

// Set up latches to branch to the new header in the unrolled iterations or
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Transforms/RewriteStatepointsForGC/preprocess.ll
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ next: ; preds = %entry
define void @test7() gc "statepoint-example" {
; CHECK-LABEL: test7
; CHECK-NOT: gc.statepoint
; Need to delete unreachable gc.statepoint invoke - tested seperately given
; Need to delete unreachable gc.statepoint invoke - tested separately given
; a correct implementation could only remove the instructions, not the block
ret void

Expand Down

0 comments on commit 418304c

Please sign in to comment.