[all-commits] [llvm/llvm-project] 10357e: [LoopUtils] Better accuracy for getLoopEstimatedTr...
ebrevnov via All-commits
all-commits at lists.llvm.org
Mon Jan 20 02:00:52 PST 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 10357e1c89b370a18500a8a8d69a68ab72db979e
https://github.com/llvm/llvm-project/commit/10357e1c89b370a18500a8a8d69a68ab72db979e
Author: Evgeniy Brevnov <evgueni.brevnov at gmail.com>
Date: 2020-01-20 (Mon, 20 Jan 2020)
Changed paths:
M llvm/lib/Transforms/Utils/LoopUtils.cpp
M llvm/test/Transforms/LoopUnroll/peel-loop-conditions-pgo-1.ll
M llvm/test/Transforms/LoopUnroll/peel-loop-pgo-deopt-idom-2.ll
M llvm/test/Transforms/LoopUnroll/peel-loop-pgo-deopt-idom.ll
M llvm/test/Transforms/LoopUnroll/peel-loop-pgo-deopt.ll
M llvm/test/Transforms/LoopUnroll/peel-loop-pgo.ll
Log Message:
-----------
[LoopUtils] Better accuracy for getLoopEstimatedTripCount.
Summary: Current implementation of getLoopEstimatedTripCount returns 1 iteration less than it should. The reason is that in bottom tested loop first iteration is executed before first back branch is taken. For example for loop with !{!"branch_weights", i32 1 // taken, i32 1 // exit} metadata getLoopEstimatedTripCount gives 1 while actual number of iterations is 2.
Reviewers: Ayal, fhahn
Reviewed By: Ayal
Subscribers: mgorny, hiraditya, zzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71990
More information about the All-commits
mailing list