]> granicus.if.org Git - llvm/commit
[CodeGenPrepare] limit overflow intrinsic matching to a single basic block (2nd try)
authorSanjay Patel <spatel@rotateright.com>
Sat, 4 May 2019 12:46:32 +0000 (12:46 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sat, 4 May 2019 12:46:32 +0000 (12:46 +0000)
commitaddf0bb7c54d87b1cbaeef7127a79c97f8b6e1a1
treed8e2a49fc10ea1d2fb8d9c52a5a418e795283b15
parentca61b388158cd6443c2cd6479b7ef428f0de0257
[CodeGenPrepare] limit overflow intrinsic matching to a single basic block (2nd try)

This is a subset of the original commit from rL359879
which was reverted because it could crash when using the 'RemovedInstructions'
structure that enables delayed deletion of dead instructions. The motivating
compile-time win does not require that change though. We should get most of
that win from this change alone.

Using/updating a dominator tree to match math overflow patterns may be very
expensive in compile-time (because of the way CGP uses a DT), so just handle
the single-block case.

See post-commit thread for rL354298 for more details:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190422/646276.html

Differential Revision: https://reviews.llvm.org/D61075

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359969 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CodeGenPrepare.cpp
test/CodeGen/X86/cgp-usubo.ll
test/Transforms/CodeGenPrepare/X86/optimizeSelect-DT.ll
test/Transforms/CodeGenPrepare/X86/overflow-intrinsics.ll