OSDN Git Service

[CodeGenPrepare] limit overflow intrinsic matching to a single basic block
authorSanjay Patel <spatel@rotateright.com>
Fri, 3 May 2019 13:09:18 +0000 (13:09 +0000)
committerSanjay Patel <spatel@rotateright.com>
Fri, 3 May 2019 13:09:18 +0000 (13:09 +0000)
commit866bc92c5d68598b8bae782de010e51a0d333c5c
treeb417c9c921a6ccd5dbf6c32dfb85e9f5724385f2
parentc0bc443a7f6a321984cc37eab5eb32ad23f978d8
[CodeGenPrepare] limit overflow intrinsic matching to a single basic block

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.

Also, we were restarting the iterator loops when doing the overflow intrinsic
transforms by marking the dominator tree for update. That was done to prevent
iterating over a removed instruction. But we can postpone the deletion using
the existing "RemovedInsts" structure, and that means we don't need to update
the DT.

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@359879 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