OSDN Git Service

Teach IRCE to look at branch weights when recognizing range checks
authorSanjoy Das <sanjoy@playingwithpointers.com>
Tue, 27 Jan 2015 21:38:12 +0000 (21:38 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Tue, 27 Jan 2015 21:38:12 +0000 (21:38 +0000)
commitfdefc694cd20958bbeb10bd66767fda371452c7c
treef61983d610acf8a7a3534832541443fc94cace8d
parent00b7a940e71ed6550a32fc69a5f11840a48ace64
Teach IRCE to look at branch weights when recognizing range checks

Splitting a loop to make range checks redundant is profitable only if
the range check "never" fails. Make this fact a part of recognizing a
range check -- a branch is a range check only if it is expected to
pass (via branch_weights metadata).

Differential Revision: http://reviews.llvm.org/D7192

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227249 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
test/Transforms/IRCE/multiple-access-no-preloop.ll
test/Transforms/IRCE/not-likely-taken.ll [new file with mode: 0644]
test/Transforms/IRCE/single-access-no-preloop.ll
test/Transforms/IRCE/single-access-with-preloop.ll
test/Transforms/IRCE/with-parent-loops.ll