| Commit message (Collapse) | Author | Age | Files | Lines | 
| ... |  | 
| | 
| 
| 
|  | 
llvm-svn: 193109
 | 
| | 
| 
| 
|  | 
llvm-svn: 193104
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
When a linkonce_odr value that is on the dso list is not unnamed_addr
we can still look to see if anything is actually using its address. If
not, it is safe to hide it.
This patch implements that by moving GlobalStatus to Transforms/Utils
and using it in Internalize.
llvm-svn: 193090
 | 
| | 
| 
| 
| 
| 
|  | 
Additionally some small comment/stylistic fixes are included as well.
llvm-svn: 193068
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
A landing pad can be jumped to only by the unwind edge of an invoke
instruction. If we eliminate a partially redundant load in a landing pad, it
will create a basic block that violates this constraint. It then leads to other
problems down the line if it tries to merge that basic block with the landing
pad. Avoid this by not eliminating the load in a landing pad.
PR17621
llvm-svn: 193064
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
switches on iN with N >= 3.
One optimization simplify-cfg performs is the converting of switches to
lookup tables if the switch has > 4 cases. This is done by:
1. Finding the max/min case value and calculating the switch case range.
2. Create a lookup table basic block.
3. Perform a check in the switch's BB to see if the input value is in
the switch's case range. If the input value satisfies said predicate
branch to the lookup table BB, otherwise branch to the switch's default
destination BB using the default value as the result.
The conditional check consists of subtracting the min case value of the
table from any input iN value and then ensuring that said value is
unsigned less than the size of the lookup table represented as an iN
value.
If the lookup table is a covered lookup table, the size of the table will be N
which is 0 as an iN value. Thus the comparison will be an `icmp ult` of an iN
value against 0 which is always false yielding the incorrect result.
This patch fixes this problem by recognizing if we have a covered lookup table
and if we do, unconditionally jumps to the lookup table BB since the covering
property of the lookup table implies no input values could not be handled by
said BB.
rdar://15268442
llvm-svn: 193045
 | 
| | 
| 
| 
| 
| 
| 
| 
|  | 
If the predecessor's being spliced into a landing pad, then we need the PHIs to
come first and the rest of the predecessor's code to come *after* the landing
pad instruction.
llvm-svn: 193035
 | 
| | 
| 
| 
|  | 
llvm-svn: 193013
 | 
| | 
| 
| 
|  | 
llvm-svn: 192910
 | 
| | 
| 
| 
|  | 
llvm-svn: 192907
 | 
| | 
| 
| 
| 
| 
|  | 
No functionality change.
llvm-svn: 192906
 | 
| | 
| 
| 
| 
| 
|  | 
Switch to sign-extension in r192575 caused 7% perf loss on 482.sphinx3.
llvm-svn: 192882
 | 
| | 
| 
| 
| 
| 
| 
|  | 
If a function has no_sanitize_thread attribute,
do not instrument memory accesses in it.
llvm-svn: 192871
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
radar://15231682
Reapply r192799,
  http://lab.llvm.org:8011/builders/lldb-x86_64-debian-clang/builds/8226
showed that the bot is still broken even with this out.
llvm-svn: 192820
 | 
| | 
| 
| 
| 
| 
|  | 
This speculatively reverts commit 192799. It might have broken a linux buildbot.
llvm-svn: 192816
 | 
| | 
| 
| 
| 
| 
|  | 
radar://15231682
llvm-svn: 192799
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
Summary:
Given a global array G[N], which is declared in this CU and has static initializer
avoid instrumenting accesses like G[i], where 'i' is a constant and 0<=i<N.
Also add a bit of stats.
This eliminates ~1% of instrumentations on SPEC2006
and also partially helps when asan is being run together with coverage.
Reviewers: samsonov
Reviewed By: samsonov
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1947
llvm-svn: 192794
 | 
| | 
| 
| 
|  | 
llvm-svn: 192717
 | 
| | 
| 
| 
| 
| 
|  | 
x86_sse42_crc32_32_8 and was not mapped to a clang builtin. I'm not even sure why this form of the instruction is even called out explicitly in the docs. Also add AutoUpgrade support to convert it into the other intrinsic with appropriate trunc and zext.
llvm-svn: 192672
 | 
| | 
| 
| 
| 
| 
| 
| 
|  | 
They were leftover from the old profiling support.
Patch by Alastair Murray.
llvm-svn: 192605
 | 
| | 
| 
| 
| 
| 
|  | 
avoid a heap allocation when this is the case.
llvm-svn: 192602
 | 
| | 
| 
| 
| 
| 
| 
| 
|  | 
Currently MSan checks that arguments of *cvt* intrinsics are fully initialized.
That's too much to ask: some of them only operate on lower half, or even
quarter, of the input register.
llvm-svn: 192599
 | 
| | 
| 
| 
|  | 
llvm-svn: 192575
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
Before this patch we relied on the order of phi nodes when we looked for phi
nodes of the same type. This could prevent vectorization of cases where there
was a phi node of a second type in between phi nodes of some type.
This is important for vectorization of an internal graphics kernel. On the test
suite + external on x86_64 (and on a run on armv7s) it showed no impact on
either performance or compile time.
radar://15024459
llvm-svn: 192537
 | 
| | 
| 
| 
| 
|  | 
Contributed-by:  Peter Zotov  <whitequark@whitequark.org>
llvm-svn: 192536
 | 
| | 
| 
| 
|  | 
llvm-svn: 192460
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
If a function seen at compile time is not necessarily the one linked to
the binary being built, it is illegal to change the actual arguments
passing to it. 
  e.g. 
   --------------------------
   void foo(int lol) {
     // foo() has linkage satisifying isWeakForLinker()
     // "lol" is not used at all.
   }
   void bar(int lo2) {
      // xform to foo(undef) is illegal, as compiler dose not know which
      // instance of foo() will be linked to the the binary being built.
      foo(lol2); 
   }
  -----------------------------
  Such functions can be captured by isWeakForLinker(). NOTE that
mayBeOverridden() is insufficient for this purpose as it dosen't include
linkage types like AvailableExternallyLinkage and LinkOnceODRLinkage.
Take link_odr* as an example, it indicates a set of *EQUIVALENT* globals
that can be merged at link-time. However, the semantic of 
*EQUIVALENT*-functions includes parameters. Changing parameters breaks
the assumption.
  Thank John McCall for help, especially for the explanation of subtle
difference between linkage types.
  rdar://11546243
llvm-svn: 192302
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
|  | 
Otherwise, we don't perform operations that would have been performed on
the scalar version.
Fixes PR17498.
llvm-svn: 192133
 | 
| | 
| 
| 
| 
| 
|  | 
a better way to fix it
llvm-svn: 192121
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
UpdatePHINodes has an optimization to reuse an existing PHI node, where it
first deletes all of its entries and then replaces them. Unfortunately, in the
case where we had duplicate predecessors (which are allowed so long as the
associated PHI entries have the same value), the loop removing the existing PHI
entries from the to-be-reused PHI would assert (if that PHI was not the one
which had the duplicates).
llvm-svn: 192001
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
Sort the operands of the other entries in the current vectorization root
according to the first entry's operands opcodes.
%conv0 = uitofp ...
%load0 = load float ...
= fmul %conv0, %load0
= fmul %load0, %conv1
= fmul %load0, %conv2
Make sure that we recursively vectorize <%conv0, %conv1, %conv2> and <%load0,
%load0, %load0>.
This makes it more likely to obtain vectorizable trees. We have to be careful
when we sort that we don't destroy 'good' existing ordering implied by source
order.
radar://15080067
llvm-svn: 191977
 | 
| | 
| 
| 
| 
| 
|  | 
was a constant.  This has a number of benefits, including producing small immediates (easier to materialize, smaller constant pools) as well as being more likely to allow the fptrunc to fuse with a preceding instruction (truncating selects are unusual).
llvm-svn: 191929
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
Generalize the API so we can distinguish symbols that are needed just for a DSO
symbol table from those that are used from some native .o.
The symbols that are only wanted for the dso symbol table can be dropped if
llvm can prove every other dso has a copy (linkonce_odr) and the address is not
important (unnamed_addr).
llvm-svn: 191922
 | 
| | 
| 
| 
|  | 
llvm-svn: 191920
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
|  | 
Don't vectorize with a runtime check if it requires a
comparison between pointers with different address spaces.
The values can't be assumed to be directly comparable.
Previously it would create an illegal bitcast.
llvm-svn: 191862
 | 
| | 
| 
| 
|  | 
llvm-svn: 191852
 | 
| | 
| 
| 
| 
| 
|  | 
Fix missing newlines, missing and extra spaces in printed messages.
llvm-svn: 191851
 | 
| | 
| 
| 
|  | 
llvm-svn: 191850
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
|  | 
GetUnderlyingObject.
This recursively strips all GEPs like the existing code. It also handles bitcasts and
other operations that do not change the pointer value.
llvm-svn: 191847
 | 
| | 
| 
| 
| 
| 
| 
| 
|  | 
Switch instructions were crashing the StructurizeCFG pass, and it's
probably easier anyway if we don't need to handle them in this pass.
Reviewed-by: Christian König <christian.koenig@amd.com>
llvm-svn: 191841
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
infrastructure.
This was essentially work toward PGO based on a design that had several
flaws, partially dating from a time when LLVM had a different
architecture, and with an effort to modernize it abandoned without being
completed. Since then, it has bitrotted for several years further. The
result is nearly unusable, and isn't helping any of the modern PGO
efforts. Instead, it is getting in the way, adding confusion about PGO
in LLVM and distracting everyone with maintenance on essentially dead
code. Removing it paves the way for modern efforts around PGO.
Among other effects, this removes the last of the runtime libraries from
LLVM. Those are being developed in the separate 'compiler-rt' project
now, with somewhat different licensing specifically more approriate for
runtimes.
llvm-svn: 191835
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
Summary:
As discussed in http://llvm-reviews.chandlerc.com/D1754,
this optimization isn't really valid for C, and fires too rarely anyway.
Reviewers: rafael, nicholas
Reviewed By: nicholas
CC: rnk, llvm-commits, nicholas
Differential Revision: http://llvm-reviews.chandlerc.com/D1769
llvm-svn: 191834
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
It's silly to merge functions like these:
define void @foo(i32 %x) {
  ret void
}
define void @bar(i32 %x) {
  ret void
}
to get
define void @bar(i32) {
  tail call void @foo(i32 %0)
  ret void
}
llvm-svn: 191786
 | 
| | 
| 
| 
| 
| 
|  | 
Patch by Alp Toker.
llvm-svn: 191757
 | 
| | 
| 
| 
|  | 
llvm-svn: 191716
 | 
| | 
| 
| 
| 
| 
| 
|  | 
The test's output doesn't change, but this ensures
this is actually hit with a different address space.
llvm-svn: 191701
 | 
| | 
| 
| 
|  | 
llvm-svn: 191699
 | 
| | 
| 
| 
|  | 
llvm-svn: 191676
 | 
| | 
| 
| 
|  | 
llvm-svn: 191675
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
|  | 
RAII helper.
Defines away the issue where cast<Instruction> would fail because constant
folding happened. Also slightly cleaner.
llvm-svn: 191674
 |