12 Commits

Author SHA1 Message Date
Nicola Zaghen
0818e789cb Rename DEBUG macro to LLVM_DEBUG.
The DEBUG() macro is very generic so it might clash with other projects.
The renaming was done as follows:
- git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g'
- git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM
- Manual change to APInt
- Manually chage DOCS as regex doesn't match it.

In the transition period the DEBUG() macro is still present and aliased
to the LLVM_DEBUG() one.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332240 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-14 12:53:11 +00:00
Michael Zolotukhin
1efc1f1838 Revert "Revert r330403 and r330413."
Reapply the patches with a fix. Thanks Ilya and Hans for the reproducer!
This reverts commit r330416.

The issue was that removing predecessors invalidated uses that we stored
for rewrite. The fix is to finish manipulating with CFG before we select
uses for rewrite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330431 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-20 13:34:32 +00:00
Ilya Biryukov
8e71a936a4 Revert r330403 and r330413.
Revert r330413: "[SSAUpdaterBulk] Use SmallVector instead of DenseMap for storing rewrites."
Revert r330403 "Reapply "[PR16756] Use SSAUpdaterBulk in JumpThreading." one more time."

r330403 commit seems to crash clang during our integrate while doing PGO build with the following stacktrace:
      #2 llvm::SSAUpdaterBulk::RewriteAllUses(llvm::DominatorTree*, llvm::SmallVectorImpl<llvm::PHINode*>*)
      #3 llvm::JumpThreadingPass::ThreadEdge(llvm::BasicBlock*, llvm::SmallVectorImpl<llvm::BasicBlock*> const&, llvm::BasicBlock*)
      #4 llvm::JumpThreadingPass::ProcessThreadableEdges(llvm::Value*, llvm::BasicBlock*, llvm::jumpthreading::ConstantPreference, llvm::Instruction*)
      #5 llvm::JumpThreadingPass::ProcessBlock(llvm::BasicBlock*)
The crash happens while compiling 'lib/Analysis/CallGraph.cpp'.

r3340413 is reverted due to conflicting changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330416 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-20 10:52:54 +00:00
Michael Zolotukhin
35a415fc01 [SSAUpdaterBulk] Use SmallVector instead of DenseMap for storing rewrites.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330413 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-20 10:31:06 +00:00
Michael Zolotukhin
e623ebc840 [SSAUpdaterBulk] Add an assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330402 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-20 07:59:57 +00:00
Michael Zolotukhin
f6646b7a16 [SSAUpdaterBulk] Add * and & to auto.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330400 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-20 07:58:54 +00:00
Michael Zolotukhin
ba04672474 [SSAUpdaterBulk] Use PredCache in ComputeLiveInBlocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330399 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-20 07:57:24 +00:00
Michael Zolotukhin
04b184b930 [SSAUpdaterBulk] Use SmallVector instead of SmallPtrSet for uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330398 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-20 07:56:00 +00:00
Michael Zolotukhin
3e304f567c [SSAUpdaterBulk] Add debug logging.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330176 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-17 04:45:40 +00:00
Michael Zolotukhin
df0745b92e [SSAUpdaterBulk] Fix linux bootstrap/sanitizer failures: explicitly specify order of evaluation.
The standard says that the order of evaluation of an expression
  s[x] = foo()
is unspecified. In our case, we first create an empty entry in the map,
then call foo(), then store its return value to the created entry. The
problem is that foo uses the map as a cache, so if it finds that there
is an entry in the map, it stops computation. This change explicitly
sets the order, thus fixing this heisenbug.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329864 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-11 23:37:37 +00:00
Michael Zolotukhin
52d8639d48 [SSAUpdaterBulk] Handle CFG with unreachable from entry blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329660 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-10 02:16:29 +00:00
Michael Zolotukhin
8496a2c80f [PR16756] Add SSAUpdaterBulk.
Summary:
SSAUpdater is a bottleneck in a number of passes, and one of the reasons
is that it performs a lot of unnecessary computations (DT/IDF) over and
over again. This patch adds a new SSAUpdaterBulk that uses existing DT
and avoids recomputing IDF when possible.

Reviewers: dberlin, davide, MatzeB

Subscribers: llvm-commits, hiraditya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329643 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-09 23:37:20 +00:00