Commit Graph

120803 Commits

Author SHA1 Message Date
Vedant Kumar
fa57ebccb8 [test] Testing write access to llvm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245074 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 17:42:50 +00:00
Justin Bogner
afc9925923 [sancov] Fix an unused variable warning introduced in r245067
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245072 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 17:03:45 +00:00
Kit Barton
e4ca1fb9f8 Reverting patch r244235.
This patch will be redone in a different way. See
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150810/292978.html
for more details.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245071 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 16:54:32 +00:00
Reid Kleckner
185d96c36b [cmake] Start adding support for LLVM_USE_SANITIZER=Address on Windows
Pass "-fsanitize=address" to the compiler and "-debug" to the linker.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245070 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 16:48:34 +00:00
Reid Kleckner
458a50de93 [sancov] Leave llvm.localescape in the entry block
Summary: Similar to the change we applied to ASan. The same test case works.

Reviewers: samsonov

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245067 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 16:45:42 +00:00
Chad Rosier
4ff88e3088 Cleanup test whitespace or lack thereof. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245065 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 16:34:15 +00:00
Chris Bieneman
0a8f7a16c0 [CMake] Fix PR14200, llvm-config output misses -fno-rtti
This change adds RTTI and Exception flags to llvm-config's cxxflags. This solution is a minimal patch to solve the issue, and is recommended for the 3.7 release branch. Tom Stellard's outstanding work is the longer term solution.

Patch By: David Wiberg

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245064 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 16:20:31 +00:00
Rafael Espindola
ea619d042f Revert "Centralize the information about which object format we are using."
This reverts commit r245047.

It was failing on the darwin bots. The problem was that when running

./bin/llc -march=msp430

llc gets to

  if (TheTriple.getTriple().empty())
    TheTriple.setTriple(sys::getDefaultTargetTriple());

Which means that we go with an arch of msp430 but a triple of
x86_64-apple-darwin14.4.0 which fails badly.

That code has to be updated to select a triple based on the value of
march, but that is not a trivial fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245062 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 15:48:41 +00:00
Davide Italiano
729c24b2e9 Convert tests under MC/ELF from macho-dump to llvm-readobj.
Yet another step towards deprecating macho-dump.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245059 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 15:16:37 +00:00
Sanjay Patel
22ac7abe6c don't repeaat function names in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245058 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 15:11:42 +00:00
Rafael Espindola
b0a171f7a0 Centralize the information about which object format we are using.
Other than some places that were handling unknown as ELF, this should
have no change. The test updates are because we were detecting
arm-coff or x86_64-win64-coff as ELF targets before.

It is not clear if the enum should live on the Triple. At least now it lives
in a single location and should be easier to move somewhere else.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245047 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 13:31:17 +00:00
James Molloy
26e1739079 Separate out BDCE's analysis into a separate DemandedBits analysis.
This allows other areas of the compiler to use BDCE's bit-tracking.
NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245039 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 11:09:09 +00:00
Simon Pilgrim
43a339e3bb Renamed min tests (typo)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245038 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 11:03:31 +00:00
James Molloy
f8e7c14a0b [AArch64] FMINNAN/FMAXNAN on f16 is not legal.
Spotted by Ahmed - in r244594 I inadvertently marked f16 min/max as legal.

I've reverted it here, and marked min/max on scalar f16's as promote. I've also added a testcase. The test just checks that the compiler doesn't fall over - it doesn't create fmin nodes for f16 yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245035 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 09:08:50 +00:00
Chandler Carruth
0d2d02d317 [PM/AA] Remove two no-op overridden functions that just delegated to the
base class anyways.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245034 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 08:39:32 +00:00
Adam Nemet
8452a3f46e [LVer] Remove unused Pass parameter from versionLoop, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245032 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 06:30:26 +00:00
Lang Hames
de445db1c4 [RuntimeDyld] Make sure code-sections aren't under-aligned.
Code-section alignment should be at least as high as the minimum
stub alignment. If the section alignment is lower it can cause
padding to be emitted resulting in alignment errors if the section
is mapped to a higher alignment on the target.

E.g. If a text section with a 4-byte alignment gets 4-bytes of
padding to guarantee 8-byte alignment for stubs but is re-mapped to
an 8-byte alignment on the target, the 4-bytes of padding will push
the stubs to 4-byte alignment causing a crash.

No test case: There is currently no way to control host section
alignment in llvm-rtdyld. This could be made testable by adding
a custom memory manager. I'll look at that in a follow-up patch.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245031 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 06:26:42 +00:00
David Majnemer
2dacece9e2 [IR] Add token types
This introduces the basic functionality to support "token types".
The motivation stems from the need to perform operations on a Value
whose provenance cannot be obscured.

There are several applications for such a type but my immediate
motivation stems from WinEH.  Our personality routine enforces a
single-entry - single-exit regime for cleanups.  After several rounds of
optimizations, we may be left with a terminator whose "cleanup-entry
block" is not entirely clear because control flow has merged two
cleanups together.  We have experimented with using labels as operands
inside of instructions which are not terminators to indicate where we
came from but found that LLVM does not expect such exotic uses of
BasicBlocks.

Instead, we can use this new type to clearly associate the "entry point"
and "exit point" of our cleanup.  This is done by having the cleanuppad
yield a Token and consuming it at the cleanupret.
The token type makes it impossible to obscure or otherwise hide the
Value, making it trivial to track the relationship between the two
points.

What is the burden to the optimizer?  Well, it turns out we have already
paid down this cost by accepting that there are certain calls that we
are not permitted to duplicate, optimizations have to watch out for
such instructions anyway.  There are additional places in the optimizer
that we will probably have to update but early examination has given me
the impression that this will not be heroic.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245029 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 05:09:07 +00:00
Karthik Bhat
20c7897930 Add support for cross block dse.
This patch enables dead stroe elimination across basicblocks.

Example:
define void @test_02(i32 %N) {
  %1 = alloca i32
  store i32 %N, i32* %1
  store i32 10, i32* @x
  %2 = load i32, i32* %1
  %3 = icmp ne i32 %2, 0
  br i1 %3, label %4, label %5

; <label>:4
  store i32 5, i32* @x
  br label %7

; <label>:5
  %6 = load i32, i32* @x
  store i32 %6, i32* @y
  br label %7

; <label>:7
  store i32 15, i32* @x
  ret void
}
In the above example dead store "store i32 5, i32* @x" is now eliminated.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245025 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 04:17:23 +00:00
Chandler Carruth
41bdb7ca96 [PM/AA] Run clang-format over the ObjCARC Alias Analysis code to
normalize its formatting before I make more substantial changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245024 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 03:57:00 +00:00
Chandler Carruth
416c002bf3 [PM/AA] Don't bother forward declaring Function and Value, just include
their headers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245023 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 03:55:36 +00:00
Saleem Abdulrasool
9465c3170c PowerPC: remove dead initialization (NFC)
Identified by the clang static analyzer.  No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245022 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 03:48:35 +00:00
Chandler Carruth
0d68ddf6ce [PM/AA] Extract the interface for GlobalsModRef into a header along with
its creation function.

This required shifting a bunch of method definitions to be out-of-line
so that we could leave most of the implementation guts in the .cpp file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245021 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 03:48:20 +00:00
Chandler Carruth
40e8a59ff9 [PM/AA] Hoist the interface to TBAA into a dedicated header along with
its creation function. Update the relevant includes accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245019 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 03:33:48 +00:00
Chandler Carruth
51d9f587b7 [PM/AA] Run clang-format over TBAA code to normalize the formatting
before making substantial changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245017 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 03:26:15 +00:00
Chandler Carruth
63147bd117 [PM/AA] Remove a stray #include that snuck in via copy/paste when
creating this header.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245016 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 03:16:11 +00:00
Chandler Carruth
0293ed6a06 [PM/AA] Clean up the SCEV-AA comment formatting and typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245015 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 03:14:50 +00:00
Chandler Carruth
72644dfdcd [PM/AA] Run clang-format over the SCEV-AA code to normalize the
formatting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245014 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 03:12:16 +00:00
Chandler Carruth
217849dc42 [PM/AA] Hoist the SCEV-AA interface to its own header and pull the
creation function into that header.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245013 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 03:11:16 +00:00
Chandler Carruth
01910b8f31 [PM/AA] Hoist ScopedNoAliasAA's interface into a header and move the
creation function there.

Same basic refactoring as the other alias analyses. Nothing special
required this time around.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245012 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 02:55:50 +00:00
Chandler Carruth
e115abc777 [PM/AA] Hoist the value handle definition for CFLAA into the header to
satisfy libc++'s std::forward_list which requires the value type to be
complete.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245011 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 02:50:34 +00:00
Chandler Carruth
59300cef7c [PM/AA] Run clang-format over the ScopedNoAliasAA pass prior to making
substantial changes to normalize any formatting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245010 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 02:46:07 +00:00
Chandler Carruth
519ed7c510 [PM/AA] Extract a minimal interface for CFLAA to its own header file.
I've used forward declarations and reorderd the source code some to make
this reasonably clean and keep as much of the code as possible in the
source file, including all the stratified set details. Just the basic AA
interface and the create function are in the header file, and the header
file is now included into the relevant locations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245009 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 02:42:20 +00:00
Chandler Carruth
c269c3d555 [PM/AA] Delete two pointlessly overridden methods on the AA interface by
the AA counter pass.

For pointsToConstantMemory, I think this is a "bug fix" as I think the
code as written will actually infloop if ever reached. For the
getModRefInfo, this is a no-op change but with a significantly simpler
form.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245007 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 02:16:12 +00:00
Chandler Carruth
0dc1606c51 [PM/AA] Sink all the actual code from AliasAnalysisCounter back into the
.cpp file to make the header much less noisy.

Also makes it easy to use a static helper rather than a public method
for printing lines of stats.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245006 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 02:12:12 +00:00
Chandler Carruth
20c9ab5fe6 [PM/AA] Run clang-format over this code to establish a clean baseline
for subsequent changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245005 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 02:07:05 +00:00
Chandler Carruth
968d0e35a5 [PM/AA] Hoist the AA counter pass into a header to match the analysis
pattern.

Also hoist the creation routine out of the generic header and into the
pass header now that we have one.

I've worked to not make any changes, even formatting ones here. I'll
clean up the formatting and other things in a follow-up patch now that
the code is in the right place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245004 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 02:05:41 +00:00
Jingyue Wu
c4aff77ec0 [SeparateConstOffsetFromGEP] sext(a)+sext(b) => sext(a+b) when a+b can't sign-overflow.
Summary:
This patch implements my promised optimization to reunites certain sexts from
operands after we extract the constant offset. See the header comment of
reuniteExts for its motivation.

One key building block that enables this optimization is Bjarke's poison value
analysis (D11212). That helps to prove "a +nsw b" can't overflow.

Reviewers: broune

Subscribers: jholewinski, sanjoy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245003 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 02:02:05 +00:00
Chandler Carruth
0d1a277d93 [PM/AA] Remove the function names and class names from doxygen comments
and generally clean up their formatting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245002 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 01:43:46 +00:00
Chandler Carruth
f6f87835da [PM/AA] Move the LibCall AA creation routine declaration to that
analysis's header file to be more consistent with other analyses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245001 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 01:43:02 +00:00
Chandler Carruth
67bd697ef7 [PM/AA] Run clang-format over LibCallAliasAnalysis prior to making
substantial changes needed for the new pass manager's AA integration.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245000 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 01:38:25 +00:00
David Blaikie
329f95975f Update ExceptionDemo for exception handling API changes (personality function call->function move)
The ExceptionDemo now compiles, but doesn't link... undefined type
references to various typeinfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244997 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 00:37:16 +00:00
Alex Lorenz
1dde2af7b6 Update MIRLangRef for MIR syntax change from r244982.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244996 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 00:36:10 +00:00
David Blaikie
54b3a03538 Fix -Wformat warnings in ExceptionDemo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244995 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 00:31:49 +00:00
David Blaikie
00c293b052 Fix up the ExceptionDemo for some API changes over the past <time>
This still doesn't build -Werror clean, but other than that it should at
least build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244994 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 00:24:56 +00:00
Chandler Carruth
62b7c9cb84 [LIR] Re-instate r244880, reverted in r244884, factoring the handling of
AliasAnalysis in LoopIdiomRecognize.

The previous commit to LIR, r244879, exposed some scary bug in the loop
pass pipeline with an assert failure that showed up on several bots.
This patch got reverted as part of getting that revision reverted, but
they're actually independent and unrelated. This patch has no functional
change and should be completely safe. It is also useful for my current
work on the AA infrastructure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244993 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 00:21:10 +00:00
Alex Lorenz
5d09c2f25d MIR Serialization: Change MIR syntax - use custom syntax for MBBs.
This commit modifies the way the machine basic blocks are serialized - now the
machine basic blocks are serialized using a custom syntax instead of relying on
YAML primitives. Instead of using YAML mappings to represent the individual
machine basic blocks in a machine function's body, the new syntax uses a single
YAML block scalar which contains all of the machine basic blocks and
instructions for that function.

This is an example of a function's body that uses the old syntax:

    body:
      - id: 0
        name: entry
        instructions:
          - '%eax = MOV32r0 implicit-def %eflags'
          - 'RETQ %eax'
    ...

The same body is now written like this:

    body: |
      bb.0.entry:
        %eax = MOV32r0 implicit-def %eflags
        RETQ %eax
    ...

This syntax change is motivated by the fact that the bundled machine
instructions didn't map that well to the old syntax which was using a single
YAML sequence to store all of the machine instructions in a block. The bundled
machine instructions internally use flags like BundledPred and BundledSucc to
determine the bundles, and serializing them as MI flags using the old syntax
would have had a negative impact on the readability and the ease of editing
for MIR files. The new syntax allows me to serialize the bundled machine
instructions using a block construct without relying on the internal flags,
for example:

   BUNDLE implicit-def dead %itstate, implicit-def %s1 ... {
      t2IT 1, 24, implicit-def %itstate
      %s1 = VMOVS killed %s0, 1, killed %cpsr, implicit killed %itstate
   }

This commit also converts the MIR testcases to the new syntax. I developed
a script that can convert from the old syntax to the new one. I will post the
script on the llvm-commits mailing list in the thread for this commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244982 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-13 23:10:16 +00:00
Sanjay Patel
9ce155daf1 don't repeat function names in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244977 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-13 22:53:20 +00:00
David Majnemer
b21cc6bd48 [IR] Cleanup indentation of EH instructions
No functional change is intended, just tidying up whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244966 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-13 22:11:40 +00:00
Simon Pilgrim
bf616c106e [AMDGPU] Use the general SMAX/SMIN/UMAX/UMIN pattern matching and remove the AMDGPU implementation
D9746 added general SMAX/SMIN/UMAX/UMIN pattern matching to SelectionDAGBuilder::visitSelect.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244960 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-13 21:40:02 +00:00