platform/upstream/llvm.git
8 years ago[dsymutil] Add (unimplemented) --flat option
Frederic Riss [Thu, 6 Aug 2015 21:05:01 +0000 (21:05 +0000)]
[dsymutil] Add (unimplemented) --flat option

dsymutil should by default generate dSYM bundles which are filesystem
hierarchies containing the debug info and an additional Info.plist.
Currently llvm-dsymutil emits raw binaries containing the debug info.
This is what we call the 'flat mode'. Add a -f/-flat option that is
supposed to enable that flat mode, but don't wire it for now, only
pass it to the tests that will need it to stay functional once we
do bundle generation by default.
This basically makes this commit NFC and removes the noise from the
actual commit that adds support for bundle generation.

llvm-svn: 244269

8 years agoThread premissions through sys::fs::create_director{y|ies}
Frederic Riss [Thu, 6 Aug 2015 21:04:55 +0000 (21:04 +0000)]
Thread premissions through sys::fs::create_director{y|ies}

llvm-svn: 244268

8 years ago[WinEH] Add documentation motivating the new EH instructions
Reid Kleckner [Thu, 6 Aug 2015 21:01:32 +0000 (21:01 +0000)]
[WinEH] Add documentation motivating the new EH instructions

This adds documentation on how to use the new EH instructions added in
r243766.

Reviewers: majnemer, reames

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

llvm-svn: 244267

8 years ago[ItaniumCXXABI] Don't import RTTI data for classes with key functions
David Majnemer [Thu, 6 Aug 2015 20:56:55 +0000 (20:56 +0000)]
[ItaniumCXXABI] Don't import RTTI data for classes with key functions

MinGW has some pretty strange behvaior around RTTI and
dllimport/dllexport:
- RTTI data is never imported
- RTTI data is only exported if the class has no key function.

llvm-svn: 244266

8 years ago[IndVars] Fix PR24356.
Sanjoy Das [Thu, 6 Aug 2015 20:43:41 +0000 (20:43 +0000)]
[IndVars] Fix PR24356.

Unsigned predicates increase or decrease agnostic of the signs of their
increments.

llvm-svn: 244265

8 years ago[IndVars] Improved logging under DEBUG(); NFC.
Sanjoy Das [Thu, 6 Aug 2015 20:43:28 +0000 (20:43 +0000)]
[IndVars] Improved logging under DEBUG(); NFC.

Before this, we'd print the modified comparision in the "Simplified
comparison" case.  That looked misleading.

llvm-svn: 244264

8 years ago[ASAN/AArch64] Make sure aarch64 is not stable-runtime
Renato Golin [Thu, 6 Aug 2015 20:34:51 +0000 (20:34 +0000)]
[ASAN/AArch64] Make sure aarch64 is not stable-runtime

llvm-svn: 244263

8 years agoConvert a few classes over to use the new TrailingObjects helper.
James Y Knight [Thu, 6 Aug 2015 20:26:32 +0000 (20:26 +0000)]
Convert a few classes over to use the new TrailingObjects helper.

This initial commit serves as an example -- the remainder of the
classes using pointer arithmetic for trailing objects will be
converted in subsequent changes.

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

llvm-svn: 244262

8 years agoRemove unused 'Owned' flag from TemplateArgumentList.
James Y Knight [Thu, 6 Aug 2015 20:26:18 +0000 (20:26 +0000)]
Remove unused 'Owned' flag from TemplateArgumentList.

llvm-svn: 244261

8 years agoConvert a bunch of loops to foreach. NFC.
Pete Cooper [Thu, 6 Aug 2015 20:22:46 +0000 (20:22 +0000)]
Convert a bunch of loops to foreach.  NFC.

After r244074, we now have a successors() method to iterate over
all the successors of a TerminatorInst.  This commit changes a bunch
of eligible loops to use it.

llvm-svn: 244260

8 years agoUpdate comments.
Rui Ueyama [Thu, 6 Aug 2015 20:05:27 +0000 (20:05 +0000)]
Update comments.

llvm-svn: 244259

8 years agoCOFF: Update a comment.
Rui Ueyama [Thu, 6 Aug 2015 19:57:21 +0000 (19:57 +0000)]
COFF: Update a comment.

llvm-svn: 244258

8 years agoAMDGPU/SI: Add Fiji support
Tom Stellard [Thu, 6 Aug 2015 19:43:02 +0000 (19:43 +0000)]
AMDGPU/SI: Add Fiji support

Patch by: Alex Deucher

llvm-svn: 244255

8 years agoAMDGPU/SI: Add support for 32-bit immediate SMRD offsets on CI
Tom Stellard [Thu, 6 Aug 2015 19:28:38 +0000 (19:28 +0000)]
AMDGPU/SI: Add support for 32-bit immediate SMRD offsets on CI

Reviewers: arsenm

Subscribers: llvm-commits

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

llvm-svn: 244254

8 years agoAMDGPU/SI: Use ComplexPatterns for SMRD addressing modes
Tom Stellard [Thu, 6 Aug 2015 19:28:30 +0000 (19:28 +0000)]
AMDGPU/SI: Use ComplexPatterns for SMRD addressing modes

Summary: This allows us to consolidate several of the TableGen patterns.

Reviewers: arsenm

Subscribers: llvm-commits

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

llvm-svn: 244253

8 years agoFix memory leaks by avoiding extra manual dynamic allocation
David Blaikie [Thu, 6 Aug 2015 19:23:33 +0000 (19:23 +0000)]
Fix memory leaks by avoiding extra manual dynamic allocation

Improvement to r244212.

llvm-svn: 244252

8 years agoFix nested CrashRecoveryContexts with LLVM_ENABLE_THREADS=OFF, allow them.
Nico Weber [Thu, 6 Aug 2015 19:21:25 +0000 (19:21 +0000)]
Fix nested CrashRecoveryContexts with LLVM_ENABLE_THREADS=OFF, allow them.

libclang uses a CrashRecoveryContext, and building a module does too. If a
module gets built through libclang, nested CrashRecoveryContexts are used.  They
work fine with threads as things are stored in ThreadLocal variables, but in
LLVM_ENABLE_THREADS=OFF builds the two recovery contexts would write to the
same globals.

To fix, keep active CrashRecoveryContextImpls in a list and have the global
point to the innermost one, and do something similar for
tlIsRecoveringFromCrash.

Necessary (but not sufficient) for PR11974 and PR20325

http://reviews.llvm.org/D11770

llvm-svn: 244251

8 years ago[libFuzzer] move the mutators to public interface so that custom mutators may reuse...
Kostya Serebryany [Thu, 6 Aug 2015 19:19:55 +0000 (19:19 +0000)]
[libFuzzer] move the mutators to public interface so that custom mutators may reuse these functions directly

llvm-svn: 244250

8 years agoOn freebsd it is possible to open a directory. Test with another error.
Rafael Espindola [Thu, 6 Aug 2015 19:12:03 +0000 (19:12 +0000)]
On freebsd it is possible to open a directory. Test with another error.

llvm-svn: 244249

8 years agoRename inst_range() to instructions() for consistency. NFC
Nico Rieck [Thu, 6 Aug 2015 19:10:45 +0000 (19:10 +0000)]
Rename inst_range() to instructions() for consistency. NFC

llvm-svn: 244248

8 years agoFix possible infinite loop in shrink wrapping when searching for save/restore
Kit Barton [Thu, 6 Aug 2015 19:01:57 +0000 (19:01 +0000)]
Fix possible infinite loop in shrink wrapping when searching for save/restore
points.

There is an infinite loop that can occur in Shrink Wrapping while searching
for the Save/Restore points.

Part of this search checks whether the save/restore points are located in
different loop nests and if so, uses the (post) dominator trees to find the
immediate (post) dominator blocks. However, if the current block does not have
any immediate (post) dominators then this search will result in an infinite
loop. This can occur in code containing an infinite loop.

The modification checks whether the immediate (post) dominator is different from
the current save/restore block. If it is not, then the search terminates and the
current location is not considered as a valid save/restore point for shrink wrapping.

Phabricator: http://reviews.llvm.org/D11607
llvm-svn: 244247

8 years agoLibDriver: Replace references to lld-link2 with lld-link.
Peter Collingbourne [Thu, 6 Aug 2015 19:00:42 +0000 (19:00 +0000)]
LibDriver: Replace references to lld-link2 with lld-link.

llvm-svn: 244246

8 years ago[Frontend] Fix crash when serializing diagnostics with really long text.
Argyrios Kyrtzidis [Thu, 6 Aug 2015 18:46:36 +0000 (18:46 +0000)]
[Frontend] Fix crash when serializing diagnostics with really long text.

rdar://21896690

llvm-svn: 244245

8 years ago[Reassociation] Fix miscompile for va_arg arguments.
Quentin Colombet [Thu, 6 Aug 2015 18:44:34 +0000 (18:44 +0000)]
[Reassociation] Fix miscompile for va_arg arguments.

iisUnmovableInstruction() had a list of instructions hardcoded which are
considered unmovable. The list lacked (at least) an entry for the va_arg
and cmpxchg instructions.
Fix this by introducing a new Instruction::mayBeMemoryDependent()
instead of maintaining another instruction list.

Patch by Matthias Braun <matze@braunis.de>.

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

rdar://problem/22118647

llvm-svn: 244244

8 years agotest: Use lld-link instead of lld-link2 as the LTO linker on Windows.
Peter Collingbourne [Thu, 6 Aug 2015 18:37:54 +0000 (18:37 +0000)]
test: Use lld-link instead of lld-link2 as the LTO linker on Windows.

The old COFF linker has been removed and lld-link now refers to the new linker.

llvm-svn: 244243

8 years agoFix memory ownership in the NeonEmitter by using values instead of pointers (smart...
David Blaikie [Thu, 6 Aug 2015 18:29:32 +0000 (18:29 +0000)]
Fix memory ownership in the NeonEmitter by using values instead of pointers (smart or otherwise)

Improvement to the memory leak fix in 244196.

Address validity is required for the Intrinsic objects, but since the
collections only ever grow (no elements are removed), deque provides
sufficient guarantees (that the objects will never be reallocated/moved
around) for this use case.

llvm-svn: 244241

8 years agoMIR Parser: Report an error when parsing duplicate memory operand flags.
Alex Lorenz [Thu, 6 Aug 2015 18:26:36 +0000 (18:26 +0000)]
MIR Parser: Report an error when parsing duplicate memory operand flags.

llvm-svn: 244240

8 years agoRevert r244154 which causes some build failure. See https://llvm.org/bugs/show_bug...
Cong Hou [Thu, 6 Aug 2015 18:17:29 +0000 (18:17 +0000)]
Revert r244154 which causes some build failure. See https://llvm.org/bugs/show_bug.cgi?id=24377.

llvm-svn: 244239

8 years agoUpdate docs for accessing !dbg attachments
Duncan P. N. Exon Smith [Thu, 6 Aug 2015 18:15:25 +0000 (18:15 +0000)]
Update docs for accessing !dbg attachments

llvm-svn: 244238

8 years ago[ARM/Unwind] Fix wrong usage of write-back on register save
Renato Golin [Thu, 6 Aug 2015 18:15:17 +0000 (18:15 +0000)]
[ARM/Unwind] Fix wrong usage of write-back on register save

The register save routine in libunwind was using write-back addressing
mode to r0 for thumb, when that was not only different from the ARM
version and more importantly the register restore, but also saving the
wrong address.

Patch by Manuel Freiberger.

Fixes PR24331.

llvm-svn: 244237

8 years agoThis patch changes the interface to enable the shrink wrapping optimization.
Kit Barton [Thu, 6 Aug 2015 18:02:53 +0000 (18:02 +0000)]
This patch changes the interface to enable the shrink wrapping optimization.

It adds a new constructor, which takes a std::function predicate function that
is run at the beginning of shrink wrapping to determine whether the optimization
should run on the given machine function. The std::function can be overridden by
each target, allowing target-specific decisions to be made on each machine
function.

This is necessary for PowerPC, as the decision to run shrink wrapping is
partially based on the ABI. Futhermore, this operates nicely with the GCC iFunc
capability, which allows option overrides on a per-function basis.

Phabricator: http://reviews.llvm.org/D11421
llvm-svn: 244235

8 years ago[sanitizer] 2-nd attempt. Add the flag handle_sigfpe that is default true to handle...
Kostya Serebryany [Thu, 6 Aug 2015 17:52:54 +0000 (17:52 +0000)]
[sanitizer] 2-nd attempt. Add the flag handle_sigfpe that is default true to handle SIGFPE crashes same as SIGSEV crashes, patch by Karl Skomski. This time the test is enabled only on x86-64 (it broke on ARM)

llvm-svn: 244234

8 years ago[AArch64] Use a static function and other minor cleanup for readability. NFC.
Chad Rosier [Thu, 6 Aug 2015 17:37:18 +0000 (17:37 +0000)]
[AArch64] Use a static function and other minor cleanup for readability. NFC.

llvm-svn: 244233

8 years ago[cmake] Handle Dragonfly BSD like FreeBSD
Reid Kleckner [Thu, 6 Aug 2015 17:17:44 +0000 (17:17 +0000)]
[cmake] Handle Dragonfly BSD like FreeBSD

Fixes build break reported in PR24358.

Patch by John Marino.

llvm-svn: 244232

8 years agodocs: Fix typo in Phabricator.rst
Reid Kleckner [Thu, 6 Aug 2015 16:57:49 +0000 (16:57 +0000)]
docs: Fix typo in Phabricator.rst

Summary: Fix a small typo in Phabricator.rst: s/your/you.

Reviewers: rnk

Subscribers: rnk, llvm-commits

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

llvm-svn: 244231

8 years agoMIR Serialization: Serialize the 'invariant' machine memory operand flag.
Alex Lorenz [Thu, 6 Aug 2015 16:55:53 +0000 (16:55 +0000)]
MIR Serialization: Serialize the 'invariant' machine memory operand flag.

llvm-svn: 244230

8 years agoFix an alignment error in `llvm::expandAtomicRMWToCmpXchg` without breaking the build...
Richard Diamond [Thu, 6 Aug 2015 16:55:03 +0000 (16:55 +0000)]
Fix an alignment error in `llvm::expandAtomicRMWToCmpXchg` without breaking the build where X86 isn't enabled.

Summary: Divide the primitive size in bits by eight so the initial load's alignment is in bytes as expected. Tested with the included unit test.

Reviewers: rengolin, jfb

Subscribers: llvm-commits

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

llvm-svn: 244229

8 years agoMIR Serialization: Serialize the 'non-temporal' machine memory operand flag.
Alex Lorenz [Thu, 6 Aug 2015 16:49:30 +0000 (16:49 +0000)]
MIR Serialization: Serialize the 'non-temporal' machine memory operand flag.

llvm-svn: 244228

8 years agoCOFF: Make test commands shorter. NFC.
Rui Ueyama [Thu, 6 Aug 2015 16:47:46 +0000 (16:47 +0000)]
COFF: Make test commands shorter. NFC.

llvm-svn: 244227

8 years agoCOFF: Remove the old COFF linker and make link an alias to link2.
Rui Ueyama [Thu, 6 Aug 2015 16:19:35 +0000 (16:19 +0000)]
COFF: Remove the old COFF linker and make link an alias to link2.

It's time to remove old COFF linker because the new one is now complete.

llvm-svn: 244226

8 years ago[AArch64] Improve the readability of the ld/st optimization pass. NFC.
Chad Rosier [Thu, 6 Aug 2015 15:50:12 +0000 (15:50 +0000)]
[AArch64] Improve the readability of the ld/st optimization pass. NFC.

llvm-svn: 244222

8 years ago[SPARC] Don't compare arch name as a string, use the enum instead.
Douglas Katzman [Thu, 6 Aug 2015 15:44:12 +0000 (15:44 +0000)]
[SPARC] Don't compare arch name as a string, use the enum instead.

Fixes PR22695

llvm-svn: 244221

8 years agoDelete broken code.
Rafael Espindola [Thu, 6 Aug 2015 15:33:21 +0000 (15:33 +0000)]
Delete broken code.

This was using a hard coded string table and getting it for every symbol.

The symbol name was already available.

llvm-svn: 244220

8 years agobar
Rafael Espindola [Thu, 6 Aug 2015 15:33:19 +0000 (15:33 +0000)]
bar

llvm-svn: 244219

8 years agoBring test back but don't check the filesytem dependent error.
Rafael Espindola [Thu, 6 Aug 2015 15:18:59 +0000 (15:18 +0000)]
Bring test back but don't check the filesytem dependent error.

llvm-svn: 244218

8 years agoFix link error on Windows when LIBOMP_USE_DEBUGGER is off
Jonathan Peyton [Thu, 6 Aug 2015 15:16:54 +0000 (15:16 +0000)]
Fix link error on Windows when LIBOMP_USE_DEBUGGER is off

Two symbols for the external debugger support were incorrectly exported when LIBOMP_USE_DEBUGGER=off.

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

llvm-svn: 244217

8 years agoMove the error handling functions to Error.h. NFC.
Rafael Espindola [Thu, 6 Aug 2015 15:08:23 +0000 (15:08 +0000)]
Move the error handling functions to Error.h. NFC.

llvm-svn: 244216

8 years agoPort the error functions from ELF to COFF.
Rafael Espindola [Thu, 6 Aug 2015 14:58:50 +0000 (14:58 +0000)]
Port the error functions from ELF to COFF.

This has a few advantages

* Less C++ code (about 300 lines less).
* Less machine code (about 14 KB of text on a linux x86_64 build).
* It is more debugger friendly. Just set a breakpoint on the exit function and
  you get the complete lld stack trace of when the error was found.
* It is a more robust API. The errors are handled early and we don't get a
  std::error_code hot potato being passed around.
* In most cases the error function in a better position to print diagnostics
  (it has more context).

llvm-svn: 244215

8 years agoReuse variable. NFC.
Rafael Espindola [Thu, 6 Aug 2015 14:51:02 +0000 (14:51 +0000)]
Reuse variable. NFC.

llvm-svn: 244214

8 years agoSilencing a -Wtype-limits warning; NFC.
Aaron Ballman [Thu, 6 Aug 2015 14:07:29 +0000 (14:07 +0000)]
Silencing a -Wtype-limits warning; NFC.

llvm-svn: 244213

8 years agoPlug memory leaks in AsmWriterEmitter::EmitPrintAliasInstruction.
Yaron Keren [Thu, 6 Aug 2015 13:18:59 +0000 (13:18 +0000)]
Plug memory leaks in AsmWriterEmitter::EmitPrintAliasInstruction.

llvm-svn: 244212

8 years agoFix minor typos. NFC.
Chad Rosier [Thu, 6 Aug 2015 12:49:40 +0000 (12:49 +0000)]
Fix minor typos. NFC.

llvm-svn: 244211

8 years agoRevert "[sanitizer] Add the flag handle_sigfpe that is default true to handle SIGFPE...
Renato Golin [Thu, 6 Aug 2015 12:42:46 +0000 (12:42 +0000)]
Revert "[sanitizer] Add the flag handle_sigfpe that is default true to handle SIGFPE crashes same as SIGSEV crashes, patch by Karl Skomski"

This reverts commit r244136, it was breaking the ARM bots for too long. We should investigate it offline.

llvm-svn: 244210

8 years ago[OPENMP 4.1] Allow references in init expression for loop-based constructs.
Alexey Bataev [Thu, 6 Aug 2015 12:30:57 +0000 (12:30 +0000)]
[OPENMP 4.1] Allow references in init expression for loop-based constructs.

OpenMP 4.1 allows to use variables with reference types in private clauses and, therefore, in init expressions of the cannonical loop forms.

llvm-svn: 244209

8 years agoCorrecting and adding tests for r244206.
Aaron Ballman [Thu, 6 Aug 2015 12:15:47 +0000 (12:15 +0000)]
Correcting and adding tests for r244206.

llvm-svn: 244208

8 years agoMark calls in thunk functions as tail-call optimization candidates
Michael Kuperstein [Thu, 6 Aug 2015 11:57:15 +0000 (11:57 +0000)]
Mark calls in thunk functions as tail-call optimization candidates

When a thunk is generated with a call to the original adjusted function,
the thunk appears in the debugger call stack. We want the backend to perform
tail-call optimization on the call, to make it invisible to the debugger.

This fixes PR24235

Patch by: amjad.aboud@intel.com
Differential Revision: http://reviews.llvm.org/D11476

llvm-svn: 244207

8 years agoAdd the "quit" command as a way to terminate clang-query interactive sessions.
Aaron Ballman [Thu, 6 Aug 2015 11:56:57 +0000 (11:56 +0000)]
Add the "quit" command as a way to terminate clang-query interactive sessions.

llvm-svn: 244206

8 years agoRevert "Divide the primitive size in bits by eight so the initial load's alignment...
Renato Golin [Thu, 6 Aug 2015 10:37:59 +0000 (10:37 +0000)]
Revert "Divide the primitive size in bits by eight so the initial load's alignment is in bytes as expected. Tested with the included unit test."

This reverts commit r244155, as it was breaking the buildbots for too long.
Should be reapplied with proper fix.

llvm-svn: 244205

8 years agollvm/lib/IR/AttributeImpl.h: Move comment block not to cover typedef, introduced...
NAKAMURA Takumi [Thu, 6 Aug 2015 09:49:17 +0000 (09:49 +0000)]
llvm/lib/IR/AttributeImpl.h: Move comment block not to cover typedef, introduced in r244164. [-Wdocumentation]

llvm-svn: 244204

8 years agoRemoving tailing whitespaces
Michael Liao [Thu, 6 Aug 2015 09:06:20 +0000 (09:06 +0000)]
Removing tailing whitespaces

llvm-svn: 244203

8 years ago[X86] Improve EmitLoweredSelect for contiguous CMOV pseudo instructions.
Michael Kuperstein [Thu, 6 Aug 2015 08:45:34 +0000 (08:45 +0000)]
[X86] Improve EmitLoweredSelect for contiguous CMOV pseudo instructions.

This change improves EmitLoweredSelect() so that multiple contiguous CMOV pseudo
instructions with the same (or exactly opposite) conditions get lowered using a single
new basic-block. This eliminates unnecessary extra basic-blocks (and CFG merge points)
when contiguous CMOVs are being lowered.

Patch by: kevin.b.smith@intel.com
Differential Revision: http://reviews.llvm.org/D11428

llvm-svn: 244202

8 years ago[X86] Add support for _MM_ALIGN16
Michael Kuperstein [Thu, 6 Aug 2015 08:24:38 +0000 (08:24 +0000)]
[X86] Add support for _MM_ALIGN16

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

llvm-svn: 244201

8 years ago[PM/AA] Clean up and homogenize comments throughout basic-aa.
Chandler Carruth [Thu, 6 Aug 2015 08:17:06 +0000 (08:17 +0000)]
[PM/AA] Clean up and homogenize comments throughout basic-aa.

llvm-svn: 244200

8 years agoFix Visual C++ error C2248:
Yaron Keren [Thu, 6 Aug 2015 07:59:26 +0000 (07:59 +0000)]
Fix Visual C++ error C2248:
'llvm::TrailingObjects<`anonymous-namespace'::Class1,short,llvm::NoTrailingTypeArg>::additionalSizeToAlloc' :
cannot access protected member declared in class
 'llvm::TrailingObjects<`anonymous-namespace'::Class1,short,llvm::NoTrailingTypeArg>'

 I'm not sure how this compiles with gcc.
 Aren't protecteded members accessible only with protected or public inheritance?

llvm-svn: 244199

8 years ago[PM/AA] Run clang-format over all of basic-aa before making more
Chandler Carruth [Thu, 6 Aug 2015 07:57:58 +0000 (07:57 +0000)]
[PM/AA] Run clang-format over all of basic-aa before making more
substantive edits.

llvm-svn: 244198

8 years ago[PM/AA] Hoist the interface for BasicAA into a header file.
Chandler Carruth [Thu, 6 Aug 2015 07:33:15 +0000 (07:33 +0000)]
[PM/AA] Hoist the interface for BasicAA into a header file.

This is the first mechanical step in preparation for making this and all
the other alias analysis passes available to the new pass manager. I'm
factoring out all the totally boring changes I can so I'm moving code
around here with no other changes. I've even minimized the formatting
churn.

I'll reformat and freshen comments on the interface now that its located
in the right place so that the substantive changes don't triger this.

llvm-svn: 244197

8 years agoPlug a memory leak in NeonEmitter: Intrinsics allocated were never released.
Yaron Keren [Thu, 6 Aug 2015 07:28:36 +0000 (07:28 +0000)]
Plug a memory leak in NeonEmitter: Intrinsics allocated were never released.

llvm-svn: 244196

8 years agoCOFF: Assign the correct symbol type to internal functions.
Peter Collingbourne [Thu, 6 Aug 2015 05:26:35 +0000 (05:26 +0000)]
COFF: Assign the correct symbol type to internal functions.

The COFFSymbolRef::isFunctionDefinition() function tests for several conditions
that are not related to whether a symbol is a function, but rather whether
the symbol meets the requirements for a function definition auxiliary record,
which excludes certain symbols such as internal functions and undefined
references. The test we need to determine the symbol type is much simpler:
we only need to compare the complex type against IMAGE_SYM_DTYPE_FUNCTION.

llvm-svn: 244195

8 years agoUpdate lldb's ExternalASTSources to match Clang r244161.
Richard Smith [Thu, 6 Aug 2015 05:13:41 +0000 (05:13 +0000)]
Update lldb's ExternalASTSources to match Clang r244161.

llvm-svn: 244194

8 years ago[ObjC] Circular containers: add support of subclasses
Alex Denisov [Thu, 6 Aug 2015 04:51:14 +0000 (04:51 +0000)]
[ObjC] Circular containers: add support of subclasses

llvm-svn: 244193

8 years ago[modules] Defer setting up the lookup table for a DeclContext until we can
Richard Smith [Thu, 6 Aug 2015 04:23:48 +0000 (04:23 +0000)]
[modules] Defer setting up the lookup table for a DeclContext until we can
determine the primary context, rather than sometimes registering the lookup
table on the wrong context.

This exposed a couple of bugs:
 * the odr violation check didn't deal properly with mergeable declarations
   if the declaration retained by name lookup wasn't in the canonical
   definition of the class
 * the (broken) RewriteDecl mechanism would emit two name lookup tables for
   the same DeclContext into the same module file (one as part of the
   rewritten declaration and one as a visible update for the old declaration)
These are both fixed too.

llvm-svn: 244192

8 years agoCOFF: ARM: Sort .pdata section correctly.
Rui Ueyama [Thu, 6 Aug 2015 03:45:27 +0000 (03:45 +0000)]
COFF: ARM: Sort .pdata section correctly.

On ARM, exception handler entries in .pdata section are 8 byte long.

llvm-svn: 244191

8 years agoSecond part of indicating when the user is stopped in optimized code.
Jason Molenda [Thu, 6 Aug 2015 03:27:10 +0000 (03:27 +0000)]
Second part of indicating when the user is stopped in optimized code.

The first part was in r243508 -- the extent of the UI changes in that
patchset was to add "[opt]" to the frame-format when a stack frame was
built with optimized code.

In this change, when a stack frame built with optimization is selected,
a message will be printed to the async output channel --

opt1.c was compiled with optimization - stepping may behave oddly; variables may not be available.

The warning will be only be printed once per source file in a debug session.
These warnings may be disabled by

settings set target.process.optimization-warnings false

Internally, a new Process::PrintWarning() method has been added for
warnings that we want to print only once to the user.  It takes a type
of warning (currently only eWarningsOptimization) and an object
pointer (CompileUnit*) - the warning will only be printed once for a
given object pointer value.

This is a bit of a prototype of this change -  I think we will be
tweaking it more in the future.  But I wanted to land this and see
how it goes.  Advanced users will find these warnings unnecessary
noise and will quickly disable them - but anyone who maintains a
debugger knows that debugging optimized code, without realizing it,
is a constant source of confusion and frustation for more typical
debugger users.

I imagine there will be more of these "warn once per whatever" style
warnings that we will want to add in the future and we'll need to
come up with a better way for enabling/disabling them.  But I'm not
srue what form that warning settings should take and I didn't want
to code up something that we regret later, so for now I just added
another process setting for this one warning.

<rdar://problem/19281172>

llvm-svn: 244190

8 years ago[PM/AA] Simplify the AliasAnalysis interface by removing a wrapper
Chandler Carruth [Thu, 6 Aug 2015 02:05:46 +0000 (02:05 +0000)]
[PM/AA] Simplify the AliasAnalysis interface by removing a wrapper
around a DataLayout interface in favor of directly querying DataLayout.

This wrapper specifically helped handle the case where this no
DataLayout, but LLVM now requires it simplifynig all of this. I've
updated callers to directly query DataLayout. This in turn exposed
a bunch of places where we should have DataLayout readily available but
don't which I've fixed. This then in turn exposed that we were passing
DataLayout around in a bunch of arguments rather than making it readily
available so I've also fixed that.

No functionality changed.

llvm-svn: 244189

8 years ago[libFuzzer] add one more mutation strategy: byte shuffling
Kostya Serebryany [Thu, 6 Aug 2015 01:29:13 +0000 (01:29 +0000)]
[libFuzzer] add one more mutation strategy: byte shuffling

llvm-svn: 244188

8 years ago[test] Another attempt to fix the test.
Argyrios Kyrtzidis [Thu, 6 Aug 2015 01:06:55 +0000 (01:06 +0000)]
[test] Another attempt to fix the test.

llvm-svn: 244187

8 years agoRename the non-coding style conformant functions in namespace Builtins
Eric Christopher [Thu, 6 Aug 2015 01:01:12 +0000 (01:01 +0000)]
Rename the non-coding style conformant functions in namespace Builtins
to match the rest of their brethren and reformat the bits that need it.

llvm-svn: 244186

8 years agoMIR Serialization: Initial serialization of the machine operand target flags.
Alex Lorenz [Thu, 6 Aug 2015 00:44:07 +0000 (00:44 +0000)]
MIR Serialization: Initial serialization of the machine operand target flags.

This commit implements the initial serialization of the machine operand target
flags. It extends the 'TargetInstrInfo' class to add two new methods that help
to provide text based serialization for the target flags.

This commit can serialize only the X86 target flags, and the target flags for
the other targets will be serialized in the follow-up commits.

Reviewers: Duncan P. N. Exon Smith
llvm-svn: 244185

8 years ago[llvm-objdump] Add missing call to exit(1).
Davide Italiano [Thu, 6 Aug 2015 00:18:52 +0000 (00:18 +0000)]
[llvm-objdump] Add missing call to exit(1).

Reported by: Rafael Espindola.

llvm-svn: 244184

8 years agoFor completeness, add a 64 bit big endian test.
Rafael Espindola [Thu, 6 Aug 2015 00:00:50 +0000 (00:00 +0000)]
For completeness, add a 64 bit big endian test.

llvm-svn: 244183

8 years agoRevert "Make sure all temporary files get created under %T."
Frederic Riss [Wed, 5 Aug 2015 23:53:38 +0000 (23:53 +0000)]
Revert "Make sure all temporary files get created under %T."

This reverts commit r244163. The workaround shouldn't be necessary
after r244172, and moreover the commit was slightly buggy as it
dis a simple mkdir without removing the directory first, which could
cause 'File exists' errors.

llvm-svn: 244182

8 years agoValueMapper: Rotate distinct node remapping algorithm
Duncan P. N. Exon Smith [Wed, 5 Aug 2015 23:52:42 +0000 (23:52 +0000)]
ValueMapper: Rotate distinct node remapping algorithm

Rotate the algorithm for remapping distinct nodes in order to simplify
how uniquing cycles get resolved.  This removes some of the recursion,
and, most importantly, exposes all uniquing cycles at the top-level.
Besides being a little more efficient -- temporary MDNodes won't live as
long -- the clearer logic should help protect against bugs like those
fixed in r243961 and r243976.

What are uniquing cycles?  Why do they present challenges when remapping
metadata?

    !0 = !{!1}
    !1 = !{!0}

!0 and !1 form a simple uniquing cycle.  When remapping from one
metadata graph to another, every uniquing cycle gets "duplicated"
through a dance:

    !0-temp = !{!1?}     ; map(!0): clone !0, VM[!0] = !0-temp
    !1-temp = !{!0?}     ; ..map(!1): clone !1, VM[!1] = !1-temp
    !1-temp = !{!0-temp} ; ..map(!1): remap !1's operands
    !2      = !{!0-temp} ; ..map(!1): uniquify: !1-temp => !2
    !0-temp = !{!2}      ; map(!0): remap !0's operands
    !3      = !{!2}      ; map(!0): uniquify: !0-temp => !3

    ; Result
    !2 = !{!3}
    !3 = !{!2}

(In the two "uniquify" steps above, the operands of !X-temp are compared
to the operands of !X.  If they're the same, then !X-temp gets RAUW'ed
to !X; if they're different, then !X-temp is promoted to a new unique
node.  The latter case always hits in for uniquing cycles, so we
duplicate all the nodes involved.)

Why is this a problem?  Uniquable Metadata nodes that have temporary
node as transitive operands keep RAUW support until the temporary nodes
get finalized.  With non-cycles, this happens automatically: when a
uniquable node's count of unresolved operands drops to zero, it
immediately sheds its own RAUW support (possibly triggering the same in
any node that references it).  However, uniquing cycles create a
reference cycle, and uniqued nodes that transitively reference a
uniquing cycle are "stuck" in an unresolved state until someone calls
`MDNode::resolveCycles()` on a node in the unresolved subgraph.

Distinct nodes should help here (and mostly do): since they aren't
uniqued anywhere, they are guaranteed not to be RAUW'ed.  They
effectively form a barrier between uniqued nodes, breaking some uniquing
cycles, and shielding uniqued nodes from uniquing cycles.

Unfortunately, with this barrier in place, the unresolved subgraph(s)
can be disjoint from the top-level node.  The mapping algorithm needs to
find at least one representative from each disjoint subgraph.  But which
nodes are *stuck*, and which will get resolved automatically?  And which
nodes are in the unresolved subgraph?  The old logic was conservative.

This commit rotates the logic for distinct nodes, so that we have access
to unresolved nodes at the top-level call to `llvm::MapMetadata()`.
Each time we return to the top-level, we know that all temporaries have
been RAUW'ed away.  Here, it's safe (and necessary) to call
`resolveCycles()` immediately on unresolved operands.

This should also perform better than the old algorithm.  The recursion
stack is shorter, temporary nodes don't live as long, and there are
fewer tracking references to unresolved nodes.  As the debug info graph
introduces more 'distinct' nodes, remapping should incrementally get
cheaper and cheaper.

Aside from possible performance improvements (and reduced cruft in the
`LLVMContext`), there should be no functionality change here.

llvm-svn: 244181

8 years agoCOFF, ELF2: Pass output file path implicitly using Config global variable.
Rui Ueyama [Wed, 5 Aug 2015 23:51:50 +0000 (23:51 +0000)]
COFF, ELF2: Pass output file path implicitly using Config global variable.

Various parameters are passed implicitly using Config global variable
already. Output file path is no different from others, so there was no
special reason to handle that differnetly.

This patch changes the signature of writeResult(SymbolTable *, StringRef)
to writeResult(SymbolTable *).

llvm-svn: 244180

8 years agoDriver: Strip -header-include-file and -diagnostic-log-file from crash repro scripts
Justin Bogner [Wed, 5 Aug 2015 23:49:44 +0000 (23:49 +0000)]
Driver: Strip -header-include-file and -diagnostic-log-file from crash repro scripts

These two arguments tend to refer to a local path that won't exist
when we try to reproduce a bug. Strip them.

llvm-svn: 244179

8 years agoRename DescriptionString -> DataLayoutString as it matches the actual
Eric Christopher [Wed, 5 Aug 2015 23:48:05 +0000 (23:48 +0000)]
Rename DescriptionString -> DataLayoutString as it matches the actual
use of the string.

llvm-svn: 244178

8 years ago[libFuzzer] avoid build warnings in non-assert build (useful warning in this case)
Kostya Serebryany [Wed, 5 Aug 2015 23:44:42 +0000 (23:44 +0000)]
[libFuzzer] avoid build warnings in non-assert build (useful warning in this case)

llvm-svn: 244177

8 years ago[test] Fix tests in non-darwin bots.
Argyrios Kyrtzidis [Wed, 5 Aug 2015 23:44:06 +0000 (23:44 +0000)]
[test] Fix tests in non-darwin bots.

llvm-svn: 244176

8 years agoCOFF: Simplify Writer interface by hiding Writer class.
Rui Ueyama [Wed, 5 Aug 2015 23:43:53 +0000 (23:43 +0000)]
COFF: Simplify Writer interface by hiding Writer class.

llvm-svn: 244175

8 years agoAdd a stat to show how often the limit to decompose GEPs in BasicAA is reached.
Wei Mi [Wed, 5 Aug 2015 23:40:30 +0000 (23:40 +0000)]
Add a stat to show how often the limit to decompose GEPs in BasicAA is reached.

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

llvm-svn: 244174

8 years agoAdd a big endian testcase.
Rafael Espindola [Wed, 5 Aug 2015 23:40:20 +0000 (23:40 +0000)]
Add a big endian testcase.

llvm-svn: 244173

8 years ago[dsymutil] Do not create temporary files in -no-output mode.
Frederic Riss [Wed, 5 Aug 2015 23:33:50 +0000 (23:33 +0000)]
[dsymutil] Do not create temporary files in -no-output mode.

The files were never written to and then deleted, but they were created
nonetheless. To prevent that, create a wrapper around the 2 variants of
createUniqueFile and use the one that only does an access(Exists) call
to check for name unicity in -no-output mode.

llvm-svn: 244172

8 years ago[dsymutil] Update source used to generate test binary.
Frederic Riss [Wed, 5 Aug 2015 23:33:45 +0000 (23:33 +0000)]
[dsymutil] Update source used to generate test binary.

Forgot to include that in the last commit.

llvm-svn: 244171

8 years agoAdd -fno-coverage-mapping flag.
Diego Novillo [Wed, 5 Aug 2015 23:27:40 +0000 (23:27 +0000)]
Add -fno-coverage-mapping flag.

This new flag allows the user to disable a previous instance of
-fcoverage-mapping, if needed.

llvm-svn: 244170

8 years agoELF2: Simplify Writer interface.
Rui Ueyama [Wed, 5 Aug 2015 23:24:46 +0000 (23:24 +0000)]
ELF2: Simplify Writer interface.

We are using Writer more like a function instead of a class.
This patch makes it a function to simplify the interface.
All details of Writer class is now hidden from other parts of the linker.

llvm-svn: 244169

8 years agoValueMapper: Simplify remap() helper function, NFC
Duncan P. N. Exon Smith [Wed, 5 Aug 2015 23:22:34 +0000 (23:22 +0000)]
ValueMapper: Simplify remap() helper function, NFC

Rename `remap()` to `remapOperands()`, and restrict its contract to
remapping operands.  Previously, it also called `mapToMetadata()`, but
this logic is hard to reason about externally.  In particular, this
refactors `mapUniquedNode()` to avoid redundant mapping calls, taking
advantage of the RAUWs that are already in place.

llvm-svn: 244168

8 years agox86: NFC remove needless InstrCompiler cast
JF Bastien [Wed, 5 Aug 2015 23:15:37 +0000 (23:15 +0000)]
x86: NFC remove needless InstrCompiler cast

Summary: The casts from String to PatFrag weren't needed if we instead provided an SDNode. This fix was suggested by @pete in D11382.

Subscribers: pete, llvm-commits

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

llvm-svn: 244167

8 years ago[NVPTX] Use LDG for pointer induction variables.
Bjarke Hammersholt Roune [Wed, 5 Aug 2015 23:11:57 +0000 (23:11 +0000)]
[NVPTX] Use LDG for pointer induction variables.

More specifically, make NVPTXISelDAGToDAG able to emit cached loads (LDG) for pointer induction variables.

Also fix latent bug where LDG was not restricted to kernel functions. I believe that this could not be triggered so far since we do not currently infer that a pointer is global outside a kernel function, and only loads of global pointers are considered for cached loads.

llvm-svn: 244166

8 years ago[libFuzzer] in dfsan mode, set labels every time we start recording traces as opposed...
Kostya Serebryany [Wed, 5 Aug 2015 23:02:57 +0000 (23:02 +0000)]
[libFuzzer] in dfsan mode, set labels every time we start recording traces as opposed to doing it at process startup. This ensures that the labels are fresh.

llvm-svn: 244165

8 years agoAdd a TrailingObjects template class.
James Y Knight [Wed, 5 Aug 2015 22:57:34 +0000 (22:57 +0000)]
Add a TrailingObjects template class.

This is intended to help support the idiom of a class that has some
other objects (or multiple arrays of different types of objects)
appended on the end, which is used quite heavily in clang.

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

llvm-svn: 244164

8 years agoMake sure all temporary files get created under %T.
Artem Belevich [Wed, 5 Aug 2015 22:54:36 +0000 (22:54 +0000)]
Make sure all temporary files get created under %T.

llvm-svn: 244163