Commit Graph

114857 Commits

Author SHA1 Message Date
Sanjay Patel
02402b3cc1 add CHECK-LABELs for better reliability
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231962 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 20:12:07 +00:00
Rafael Espindola
0c78583bf6 Put jump tables in unique sections on COFF.
If a function is going in an unique section (because of -ffunction-sections
for example), putting a jump table in .rodata will keep .rodata alive and
that will keep alive any other function that also has a jump table.

Instead, put the jump table in a unique section that is associated with the
function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231961 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 19:58:37 +00:00
Tim Northover
52f83a9ab3 ARM: simplify and extend byval handling
The main issue being fixed here is that APCS targets handling a "byval align N"
parameter with N > 4 were miscounting what objects were where on the stack,
leading to FrameLowering setting the frame pointer incorrectly and clobbering
the stack.

But byval handling had grown over many years, and had multiple layers of cruft
trying to compensate for each other and calculate padding correctly. This only
really needs to be done once, in the HandleByVal function. Elsewhere should
just do what it's told by that call.

I also stripped out unnecessary APCS/AAPCS distinctions (now that Clang emits
byvals with the correct C ABI alignment), which simplified HandleByVal.

rdar://20095672

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231959 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 18:54:22 +00:00
Frederic Riss
fb14969197 [dsymutil] Add missing headers.
No build failure, found by code inspection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231958 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 18:46:01 +00:00
Frederic Riss
c45c6d4403 [dsymutil] Gather function ranges during DIE selection.
Gather the function ranges [low_pc, high_pc) during DIE selection and
store them along with the offset to apply to them to get the linked
addresses.

This is just the data collection part, it comes with no tests. That
information will be used in multiple followup commits to perform the
relocation of line tables and range sections among other things, and
these commits will add tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231957 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 18:45:59 +00:00
Frederic Riss
7944cd1ed2 [dsymutil] Small clang-format patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231956 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 18:45:57 +00:00
Frederic Riss
89393bbba6 [dsymutil] Correctly clone address attributes.
DW_AT_low_pc on functions is taken care of by the relocation processing, but
DW_AT_high_pc and DW_AT_low_pc on other lexical scopes need special handling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231955 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 18:45:52 +00:00
Eric Christopher
ca75f1df99 Remove the need to cache the subtarget in the R600 TargetRegisterInfo
classes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231954 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 18:43:21 +00:00
Eric Christopher
138fe781d2 Have getRegPressureSetLimit take a MachineFunction so that a
we can inspect the subtarget and function when computing values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231951 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 18:34:58 +00:00
David Majnemer
9c2d178707 InstCombine: Don't fold call bitcast into args if callee is byval
This fixes a bug reported here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150309/265341.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231948 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 18:03:05 +00:00
Kit Barton
c5860523be Updated with list of possible improvements we are tracking internally
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231946 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 17:43:43 +00:00
Juergen Ributzka
9814f7b92c Add the "vbroadcasti128" instruction back.
This is a follow-up to r231182. This adds the "vbroadcasti128" instruction
back, but without the intrinsic mapping. Also add a test to check the
instriction encoding.

This is related to rdar://problem/18742778.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231945 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 17:29:03 +00:00
Derek Schuff
87e6561f34 Make NaCl's use of .init_array for static constructors match Linux
Summary:
The generic ELF TargetObjectFile defaults to .ctors, but Linux's
defaults to .init_array by calling InitializeELF with the value of
UseInitArray from TargetMachine. Make NaCl's behavior match.

Reviewers: jvoung
Differential Revision: http://reviews.llvm.org/D8240

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231934 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 16:16:09 +00:00
Benjamin Kramer
2175eac141 Wrap in __MINGW32__ to avoid warnings from msvc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231933 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 16:09:02 +00:00
Benjamin Kramer
e513fc118d Add missing namespace specifier for MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231930 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 15:53:24 +00:00
Benjamin Kramer
20f78d477e RtlCaptureContext is absent from the mingw32 headers, provide a prototype.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231929 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 15:41:15 +00:00
Sanjay Patel
c2e4231627 Inliner should not add callgraph edges for intrinsic calls (PR22857)
The CallGraphNode function "addCalledFunction()" asserts that edges are not to intrinsics.

This patch makes sure that the Inliner does not add such an edge to the callgraph.

Fix for clang crash by assertion: https://llvm.org/bugs/show_bug.cgi?id=22857

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231927 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 15:12:32 +00:00
Greg Bedwell
756a12d0d1 Revert "[CMake] Don't pass in MSVC warning flags as definitions"
reverting while I investigate why it broke the sanitizer-windows build.
This reverts commit r231924.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231925 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 14:57:48 +00:00
Greg Bedwell
264d962191 [CMake] Don't pass in MSVC warning flags as definitions
NFC currently but required as a prerequisite for using
the Microsoft resource compiler in conjunction with
CMake's ninja generator, which knows how to filter flags
appropriately, but not definitions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231924 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 14:26:29 +00:00
Benjamin Kramer
410ba460a0 Prefer pipes over temporary files in a feeble attempt to stabilize this test on windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231923 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 13:55:41 +00:00
Dan Liew
bd07f437a0 Fix too short title underline reported by build-bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231921 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 13:34:49 +00:00
Rafael Espindola
4d7b50578f Relax CHECK to match mips syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231919 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 12:48:24 +00:00
Elena Demikhovsky
13cc6f2b6e AVX-512: Added SKX forms of shift instructions.
Added rotation instructions, encoding only.
Added encoding tests for all these forms.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231916 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 10:25:42 +00:00
Justin Bogner
e9ae43acf7 Now that r231902's test is executed, make it actually pass
As of r231908, the test I added in r231902 actually gets run - but I'd
checked in a stale version of the input so it didn't pass. Fix the
input and un-xfail the test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231911 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 08:17:25 +00:00
Owen Anderson
1b3b8e5be8 Fix another verifier crash where a GC intrinsic would look at the internals of another intrinsic in order to verify itself.
This causes a crash if the referenced intrinsic was malformed.  In this case, we
would already have reported an error on the referenced intrinsic, but then
crashed on the second one when it tried to introspect the first without
error checking.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231910 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 06:57:30 +00:00
Daniel Jasper
21d3c12750 Make test added in r231902 actually be executed.
There were also errors in the CHECK line which I fixed and the test
doesn't actually pass as the "100" is in the wrong line. Not sure
whether this is a test failure or a coverage failure so making the test
XFAIL for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231908 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 06:44:51 +00:00
Rafael Espindola
a5415bcc57 Don't print labels that on ELF are never used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231904 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 04:20:31 +00:00
Justin Bogner
d39109de09 InstrProf: Teach llvm-cov to handle universal binaries when given -arch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231902 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 02:30:51 +00:00
Rafael Espindola
e6e0135d1a Relax label CHECK to mach COFF syntax.
Should fix the cygwin bots.

I added a cygwin specific test that would have caught this on Linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231899 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 01:08:32 +00:00
Rafael Espindola
658236dec2 Print section start labels when first switching to the section.
This is less brittle and avoids polluting the start of the file with every
debug section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231898 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 00:51:37 +00:00
Lang Hames
94c37b0b6a [Orc][MCJIT][RuntimeDyld] Re-apply r231726 and r231724 with fix suggested by
Dave Blaikie. Thanks Dave!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231896 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 00:43:26 +00:00
Chandler Carruth
8ec61c101a Fix a grammar issue I introduced.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231894 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 00:19:01 +00:00
Chandler Carruth
bc026689ab Inspired by r231891, use gender neutral pronouns in the places I've
found in LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231893 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 00:15:44 +00:00
Andrew Kaylor
dd3224b24f Fix Value dangling reference debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231889 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 23:55:38 +00:00
Eric Christopher
4ec858ec4b Have TargetRegisterInfo::getLargestLegalSuperClass take a
MachineFunction argument so that it can look up the subtarget
rather than using a cached one in some Targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231888 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 23:46:01 +00:00
Eric Christopher
b8de3287ee Remove subtarget dependence from HexagonRegisterInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231887 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 23:45:55 +00:00
Rafael Espindola
48dfe610b0 Split test in two to handle building without x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231886 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 23:44:12 +00:00
Eric Christopher
597013d371 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231883 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 23:22:04 +00:00
Rafael Espindola
e58e7e6476 Add missing section symbol to COFF's .debug_types.dwo.
Should bring the cygwin bots back.

I added a triple to the test that was failing so that it would have failed
on Linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231882 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 23:06:32 +00:00
Philip Reames
fb4ffccacb If a conditional branch jumps to the same target, remove the condition
Given that large parts of inst combine is restricted to instructions which have one use, getting rid of a use on the condition can help the effectiveness of the optimizer. Also, it allows the condition to potentially be deleted by instcombine rather than waiting for another pass.

I noticed this completely by accident in another test case. It's not anything that actually came from a real workload.

p.s. We should probably do the same thing for switch instructions.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231881 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 22:52:37 +00:00
Paul Robinson
107918efa2 Emit correct linkage-name attribute based on DWARF version.
There are still 4 tests that check for DW_AT_MIPS_linkage_name,
because they specify DWARF 2 or 3 in the module metadata. So, I didn't
create an explicit version-based test for the attribute.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231880 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 22:44:45 +00:00
Philip Reames
7c7b72a066 Infer known bits from dominating conditions
This patch adds limited support in ValueTracking for inferring known bits of a value from conditional expressions which must be true to reach the instruction we're trying to optimize. At this time, the feature is off by default. Once landed, I'm hoping for feedback from others on both profitability and compile time impact.

Forms of conditional value propagation have been tried in LLVM before and have failed due to compile time problems.  In an attempt to side step that, this patch only considers conditions where the edge leaving the branch dominates the context instruction. It does not attempt full dataflow.  Even with that restriction, it handles many interesting cases:
 * Early exits from functions
 * Early exits from loops (for context instructions in the loop and after the check)
 * Conditions which control entry into loops, including multi-version loops (such as those produced during vectorization, IRCE, loop unswitch, etc..)

Possible applications include optimizing using information provided by constructs such as: preconditions, assumptions, null checks, & range checks.

This patch implements two approaches to the problem that need further benchmarking.  Approach 1 is to directly walk the dominator tree looking for interesting conditions.  Approach 2 is to inspect other uses of the value being queried for interesting comparisons.  From initial benchmarking, it appears that Approach 2 is faster than Approach 1, but this needs to be further validated.  

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231879 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 22:43:20 +00:00
Eric Christopher
57849e3bb4 Remove the use of the subtarget in MCCodeEmitter creation and
update all ports accordingly. Required a couple of small rewrites
in handling subtarget features during creation in PPC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231861 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 22:03:14 +00:00
Rafael Espindola
f3d745cdc9 Create symbols marking the start of a section earlier.
This lets us pass the symbol to the constructor and avoid the mutable field.

This also opens the way for outputting the symbol only when needed, instead
of outputting them at the start of the file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231859 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 22:00:25 +00:00
Eric Christopher
a1cc020e29 Remove createAMDGPUMCCodeEmitter and instead just register the correct
MCCodeEmitter creation routine based on TargetMachine since the only
64-bit R600 gpus are part of the GCN target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231856 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 21:57:34 +00:00
Quentin Colombet
7775242da3 [CodeGenPrepare] Refine the cost model provided by the promotion helper.
- Use TargetLowering to check for the actual cost of each extension.
- Provide a factorized method to check for the cost of an extension:
  TargetLowering::isExtFree.
- Provide a virtual method TargetLowering::isExtFreeImpl for targets to be able
  to tune the cost of non-free extensions.

This refactoring offers a better granularity to model what really happens on
different targets.

No performance changes and very few code differences.

Part of <rdar://problem/19267165> 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231855 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 21:48:15 +00:00
Adam Nemet
31f1cc5790 [LoopAccesses] Add debug message to indicate the result of the analysis
The debug message was pretty confusing here.  It only reported the
situation with memchecks without the result of the dependence analysis.

Now it prints whether the loop is safe from the POV of the dependence
analysis and if yes, whether we need memchecks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231854 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 21:47:39 +00:00
Rafael Espindola
b3d108b39a Move a non-trivial virtual function out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231853 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 21:35:16 +00:00
Colin LeMahieu
7a46f6f381 [Hexagon] Adding frame index + add load/store patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231850 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 21:24:13 +00:00
Rafael Espindola
5c4720d556 clang-format code that is about to change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231848 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 21:16:18 +00:00