Matt Arsenault [Fri, 20 Feb 2015 22:10:33 +0000 (22:10 +0000)]
Add generic fmad DAG node.
This allows sharing of FMA forming combines to work
with instructions that have the same semantics as a separate
multiply and add.
This is expand by default, and only formed post legalization
so it shouldn't have much impact on targets that do not want it.
llvm-svn: 230070
Rui Ueyama [Fri, 20 Feb 2015 22:10:28 +0000 (22:10 +0000)]
Remove YAML/Native round-trip passes.
The round-trip passes were introduced in r193300. The intention of
the change was to make sure that LLD is capable of reading end
writing such file formats.
But that turned out to be yet another over-designed stuff that had
been slowing down everyday development.
The passes ran after the core linker and before the writer. If you
had an additional piece of information that needs to be passed from
front-end to the writer, you had to invent a way to save the data to
YAML/Native. These passes forced us to do that even if that data
was not needed to be represented neither in an object file nor in
an executable/DSO. It doesn't make sense. We don't need these passes.
http://reviews.llvm.org/D7480
llvm-svn: 230069
Philip Reames [Fri, 20 Feb 2015 22:05:18 +0000 (22:05 +0000)]
[RewriteStatepointsForGC] More style cleanup [NFC]
Use llvm_unreachable where appropriate, use SmallVector where easy to do so, introduce typedefs for planned type migrations.
llvm-svn: 230068
Adrian Prantl [Fri, 20 Feb 2015 21:53:12 +0000 (21:53 +0000)]
Wrap clang module files in a Mach-O, ELF, or COFF container.
This is a necessary prerequisite for debugging with modules.
The .pcm files become containers that hold the serialized AST which allows
us to store debug information in the module file that can be shared by all
object files that were built importing the module.
rdar://problem/
19104245
This reapplies r230044 with a fixed configure+make build and updated
dependencies.
llvm-svn: 230067
Greg Clayton [Fri, 20 Feb 2015 21:51:06 +0000 (21:51 +0000)]
Make sure the public state is eStateStopped when we return from SBTarget::LoadCore() by hijacking the public event queue so we can ensure that the event gets consumed and the public state of the process (StateType SBProcess::GetState()) returns eStateStopped.
llvm-svn: 230066
Enrico Granata [Fri, 20 Feb 2015 21:48:38 +0000 (21:48 +0000)]
Start the refactoring of globbing
- Add Host::GlobArguments() to perform local-globbing
I implemented this on OSX and Windows in terms of argdumper (Windows implementation is essentially the same as the OSX version + a change in binary name and some string magic)
Other platforms did not specifically chime in, so I left it unimplemented for them for the time being. Please feel free to fill in the blanks
- Add Platform::GlobArguments() to support remote-globbing
For now, no feature change here - but now we have infrastructure to help GDBRemote targets to support globbing - and patches to that effect will follow
No visible feature change
llvm-svn: 230065
Ben Langmuir [Fri, 20 Feb 2015 21:46:39 +0000 (21:46 +0000)]
Don't try to rebuild modules on umbrella header mismatch
There are two issues here:
1) It's too late to rebuild at this point, because we won't go through
removeModules and when we try to reload the new .pcm we'll get the old
one instead. We might be able to call removeModules after an OutOfDate
here, but I'm not yet confident that it is always safe to do so.
2) In practice, this check fails spuriously when the umbrella header
appears to change because of a VFS change that means it maps to a
different copy of the same file. Because of this, we just skip the
check for now.
llvm-svn: 230064
Philip Reames [Fri, 20 Feb 2015 21:34:11 +0000 (21:34 +0000)]
[RewriteStatepointsForGC] Remove notion of SafepointBounds [NFC]
The notion of a range of inserted safepoint related code is no longer really applicable. This survived over from an earlier implementation. Just saving the inserted gc.statepoint and working from that is far clearer given the current code structure. Particularly when invokable statepoints get involved.
llvm-svn: 230063
Chris Bieneman [Fri, 20 Feb 2015 21:28:18 +0000 (21:28 +0000)]
Raising minimum required CMake version to 2.8.12.2.
llvm-svn: 230062
Jacques Pienaar [Fri, 20 Feb 2015 21:09:01 +0000 (21:09 +0000)]
Fix merging of << at end of input.
Commit of review http://reviews.llvm.org/D7766
llvm-svn: 230061
Greg Clayton [Fri, 20 Feb 2015 20:59:47 +0000 (20:59 +0000)]
Avoid a race condition when loading core files where the process might still be handling the eStateStopped event we post to the private state thread causing us to return from SBTarget::LoadCore() before the process is ready to have API calls used on it.
This fixes a crasher that could happen when loading core files from scripts.
llvm-svn: 230060
Eric Christopher [Fri, 20 Feb 2015 20:56:39 +0000 (20:56 +0000)]
Grab the DataLayout off of the TargetMachine since that's where
it's stored.
llvm-svn: 230059
Benjamin Kramer [Fri, 20 Feb 2015 20:49:25 +0000 (20:49 +0000)]
LoopRotate: When reconstructing loop simplify form don't split edges from indirectbrs.
Yet another chapter in the endless story. While this looks like we leave
the loop in a non-canonical state this replicates the logic in
LoopSimplify so it doesn't diverge from the canonical form in any way.
PR21968
llvm-svn: 230058
Duncan P. N. Exon Smith [Fri, 20 Feb 2015 20:35:17 +0000 (20:35 +0000)]
IR: Change MDFile to directly store the filename/directory
In the old (well, current) schema, there are two types of file
references: untagged and tagged (the latter references the former).
!0 = !{!"filename", !"/directory"}
!1 = !{!"0x29", !1} ; DW_TAG_file_type [filename] [/directory]
The interface to `DIBuilder` universally takes the tagged version,
described by `DIFile`. However, most `file:` references actually use
the untagged version directly.
In the new hierarchy, I'm merging this into a single node: `MDFile`.
Originally I'd planned to keep the old schema unchanged until after I
moved the new hierarchy into place.
However, it turns out to be trivial to make `MDFile` match both nodes at
the same time.
- Anyone referencing !1 does so through `DIFile`, whose implementation
I need to gut anyway (as I do the rest of the `DIDescriptor`s).
- Anyone referencing !0 just references an `MDNode`, and expects a
node with two `MDString` operands.
This commit achieves that, and updates all the testcases for the parts
of the new hierarchy that used the two-node schema (I've replaced the
untagged nodes with `distinct !{}` to make the diff clear (otherwise the
metadata all gets renumbered); it might be worthwhile to come back and
delete those nodes and renumber the world, not sure).
llvm-svn: 230057
Peter Collingbourne [Fri, 20 Feb 2015 20:31:18 +0000 (20:31 +0000)]
Add test suite for the Control Flow Integrity feature.
Differential Revision: http://reviews.llvm.org/D7738
llvm-svn: 230056
Peter Collingbourne [Fri, 20 Feb 2015 20:30:56 +0000 (20:30 +0000)]
Implement Control Flow Integrity for virtual calls.
This patch introduces the -fsanitize=cfi-vptr flag, which enables a control
flow integrity scheme that checks that virtual calls take place using a vptr of
the correct dynamic type. More details in the new docs/ControlFlowIntegrity.rst
file.
It also introduces the -fsanitize=cfi flag, which is currently a synonym for
-fsanitize=cfi-vptr, but will eventually cover all CFI checks implemented
in Clang.
Differential Revision: http://reviews.llvm.org/D7424
llvm-svn: 230055
Peter Collingbourne [Fri, 20 Feb 2015 20:30:47 +0000 (20:30 +0000)]
Introduce bitset metadata format and bitset lowering pass.
This patch introduces a new mechanism that allows IR modules to co-operatively
build pointer sets corresponding to addresses within a given set of
globals. One particular use case for this is to allow a C++ program to
efficiently verify (at each call site) that a vtable pointer is in the set
of valid vtable pointers for the class or its derived classes. One way of
doing this is for a toolchain component to build, for each class, a bit set
that maps to the memory region allocated for the vtables, such that each 1
bit in the bit set maps to a valid vtable for that class, and lay out the
vtables next to each other, to minimize the total size of the bit sets.
The patch introduces a metadata format for representing pointer sets, an
'@llvm.bitset.test' intrinsic and an LTO lowering pass that lays out the globals
and builds the bitsets, and documents the new feature.
Differential Revision: http://reviews.llvm.org/D7288
llvm-svn: 230054
Jozef Kolek [Fri, 20 Feb 2015 20:26:52 +0000 (20:26 +0000)]
Reversed revision 229706. The reason is regression, which is caused by the
usage of instruction ADDU16 by CodeGen. For this instruction an improper
register is allocated, i.e. the register that is not from register set defined
for the instruction.
llvm-svn: 230053
Adrian Prantl [Fri, 20 Feb 2015 20:00:27 +0000 (20:00 +0000)]
Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."
This reverts commit r230044 while dealing with buildbot breakage.
Conflicts:
test/Modules/module_container.m
llvm-svn: 230052
David Majnemer [Fri, 20 Feb 2015 19:58:48 +0000 (19:58 +0000)]
Verifier: Unused comdats might not have a corresponding GV
This fixes PR22646.
llvm-svn: 230051
Eric Christopher [Fri, 20 Feb 2015 19:54:07 +0000 (19:54 +0000)]
Fix an asan use-after-free bug introduced by the asm printer
changes to remove non-Function based subtargets out of the asm
printer. For module level emission we'll need to construct up
an MCSubtargetInfo so that we can encode instructions for
emission.
llvm-svn: 230050
Enrico Granata [Fri, 20 Feb 2015 19:54:06 +0000 (19:54 +0000)]
Add the new file to the CMakeLists. This should appease the Windows bot
llvm-svn: 230049
Adrian Prantl [Fri, 20 Feb 2015 19:52:43 +0000 (19:52 +0000)]
Require a target for this testacse.
llvm-svn: 230048
Philip Reames [Fri, 20 Feb 2015 19:51:56 +0000 (19:51 +0000)]
[GC, RewriteStatepointsForGC] Style cleanup and bug fix
When doing style cleanup, I noticed a minor bug in this code. If we have a pointer that we think is unused after a statepoint and thus doesn't need relocation, we store a null pointer into the alloca we're about to promote. This helps turn a mistake in liveness analysis into an easily debuggable crash. It turned out this code had never been updated to handle invoke statepoints.
There's no test for this. Without a bug in liveness, it appears impossible to make this trigger in a way which is visible in the resulting IR. We might store the null, but when promoting the alloca, there will be no uses and thus nothing to test against. Suggestions on how to test are very welcome.
llvm-svn: 230047
Enrico Granata [Fri, 20 Feb 2015 19:46:30 +0000 (19:46 +0000)]
Add an OptionValueLanguage class
llvm-svn: 230046
Reid Kleckner [Fri, 20 Feb 2015 19:46:02 +0000 (19:46 +0000)]
Use unreachable instead of assert(false) to silence MSVC warning
llvm-svn: 230045
Adrian Prantl [Fri, 20 Feb 2015 19:44:52 +0000 (19:44 +0000)]
Wrap clang module files in a Mach-O, ELF, or COFF container.
This is a necessary prerequisite for debugging with modules.
The .pcm files become containers that hold the serialized AST which allows
us to store debug information in the module file that can be shared by all
object files that were built importing the module.
rdar://problem/
19104245
llvm-svn: 230044
Andrea Di Biagio [Fri, 20 Feb 2015 19:37:14 +0000 (19:37 +0000)]
[X86][FastIsel] Teach how to select float-half conversion intrinsics.
This patch teaches X86FastISel how to select intrinsic 'convert_from_fp16' and
intrinsic 'convert_to_fp16'.
If the target has F16C, we can select VCVTPS2PHrr for a float-half conversion,
and VCVTPH2PSrr for a half-float conversion.
Differential Revision: http://reviews.llvm.org/D7673
llvm-svn: 230043
Philip Reames [Fri, 20 Feb 2015 19:26:04 +0000 (19:26 +0000)]
[GC] Style cleanup for RewriteStatepointForGC (1 of many) [NFC]
Starting to update variable naming and types to match LLVM style. This will be an incremental process to minimize the chance of breakage as I work. Step one, rename member variables to LLVM CamelCase and use llvm's ADT. Much more to come.
llvm-svn: 230042
Chris Bieneman [Fri, 20 Feb 2015 19:02:59 +0000 (19:02 +0000)]
Setting up CMake to default to Debug when no build type is specified.
Summary: Turns out if you don't set CMAKE_BUILD_TYPE the default is an empty string. This results in some of the behaviors of debug builds, but not all of them. For example ENABLE_ASSERTIONS is false.
Reviewers: rnk
Reviewed By: rnk
Subscribers: chapuni, llvm-commits
Differential Revision: http://reviews.llvm.org/D7360
llvm-svn: 230041
Philip Reames [Fri, 20 Feb 2015 18:56:14 +0000 (18:56 +0000)]
Bugfix for 229954
Before calling Function::getGC to test for enablement, we need to make sure there's actually a GC at all via Function::hasGC. Otherwise, we'd crash on functions without a GC. Thankfully, this only mattered if you manually scheduled the pass, but still, oops. :(
llvm-svn: 230040
Eric Christopher [Fri, 20 Feb 2015 18:53:42 +0000 (18:53 +0000)]
Remove a use of the Subtarget in the darwin ppc asm printer.
EmitFunctionStubs is called from doFinalization and so can't
depend on the Subtarget existing. It's also irrelevant as
we know we're darwin since we're in the darwin asm printer.
llvm-svn: 230039
Eric Christopher [Fri, 20 Feb 2015 18:44:17 +0000 (18:44 +0000)]
Get the function specific subtarget.
llvm-svn: 230038
Eric Christopher [Fri, 20 Feb 2015 18:44:15 +0000 (18:44 +0000)]
Get the cached subtarget off the MachineFunction rather than
inquiring for a new one from the TargetMachine.
llvm-svn: 230037
Oleksiy Vyalov [Fri, 20 Feb 2015 18:34:03 +0000 (18:34 +0000)]
Introduce FileSystem::CalculateMD5AsString that supports any platform and make existing FileSystem::CalculateMD5 to use it.
http://reviews.llvm.org/D7771
llvm-svn: 230036
Andrey Churbanov [Fri, 20 Feb 2015 18:19:41 +0000 (18:19 +0000)]
Two warning messages fixed.
llvm-svn: 230035
Andrey Churbanov [Fri, 20 Feb 2015 18:17:03 +0000 (18:17 +0000)]
Misprint in comment fixed
llvm-svn: 230034
Andrey Churbanov [Fri, 20 Feb 2015 18:14:43 +0000 (18:14 +0000)]
Detect Intel MIC architecture and set some defaults at run time instead of build time.
llvm-svn: 230033
Andrey Churbanov [Fri, 20 Feb 2015 18:09:27 +0000 (18:09 +0000)]
Removed unused varargs from __kmpc_flush function.
llvm-svn: 230032
Rafael Espindola [Fri, 20 Feb 2015 18:08:57 +0000 (18:08 +0000)]
Add -funique-section-names and -fno-unique-section-names options.
For now -funique-section-names is the default, so no change in default behavior.
The total .o size in a build of llvm and clang goes from
241687775 to
230649031
bytes if -fno-unique-section-names is used.
llvm-svn: 230031
Andrey Churbanov [Fri, 20 Feb 2015 18:05:17 +0000 (18:05 +0000)]
Added new user-guided lock api, currently disabled. Use KMP_USE_DYNAMIC_LOCK=1 to enable it.
llvm-svn: 230030
Andrey Churbanov [Fri, 20 Feb 2015 17:57:58 +0000 (17:57 +0000)]
Changed default stack offset for threads on non-Mac architectures to a CACHE_LINE.
llvm-svn: 230029
Ilia K [Fri, 20 Feb 2015 17:56:05 +0000 (17:56 +0000)]
Minor changes after r229901: move the CMICmdCmdStackSelectFrame to the end of header file
llvm-svn: 230028
Andrey Churbanov [Fri, 20 Feb 2015 17:55:48 +0000 (17:55 +0000)]
Added some compiler flags for security on Linux and Mac link stages.
llvm-svn: 230027
Alexey Samsonov [Fri, 20 Feb 2015 17:41:59 +0000 (17:41 +0000)]
[Sanitizer] Refactor SuppressionContext class.
SuppressionContext is no longer a singleton, shared by all sanitizers,
but a regular class. Each of ASan, LSan, UBSan and TSan now have their
own SuppressionContext, which only parses suppressions specific to
that sanitizer.
"suppressions" flag is moved away from common flags into tool-specific
flags, so the user now may pass
ASAN_OPTIONS=suppressions=asan_supp.txt LSAN_OPIONS=suppressions=lsan_supp.txt
in a single invocation.
llvm-svn: 230026
Ilia K [Fri, 20 Feb 2015 17:21:57 +0000 (17:21 +0000)]
Forgot to remove initialization of MiTestCaseBase.mydir in r230022
llvm-svn: 230025
Sanjay Patel [Fri, 20 Feb 2015 16:55:27 +0000 (16:55 +0000)]
canonicalize a v2f64 blendi of 2 registers
This canonicalization step saves us 3 pattern matching possibilities * 4 math ops
for scalar FP math that uses xmm regs. The backend can re-commute the operands
post-instruction-selection if that makes register allocation better.
The tests in llvm/test/CodeGen/X86/sse-scalar-fp-arith.ll cover this scenario already,
so there are no new tests with this patch.
Differential Revision: http://reviews.llvm.org/D7777
llvm-svn: 230024
Benjamin Kramer [Fri, 20 Feb 2015 16:35:42 +0000 (16:35 +0000)]
Put MSVC back into the dumb compiler's corner.
It fails to compile std::trivially_copyable for forward-declared enums.
llvm-svn: 230023
Ilia K [Fri, 20 Feb 2015 16:34:33 +0000 (16:34 +0000)]
Refactor lldb-mi tests
Summary:
This patch includes following changes:
* split lldb-mi tests into separate folders. It will make our life simpler because we can modify a test program of certain test and don't worry about other tests
* a bit refactoring
* fix comments
* improve some tests
Reviewers: emaste, clayborg, abidh
Reviewed By: clayborg, abidh
Subscribers: clayborg, lldb-commits, emaste, abidh
Differential Revision: http://reviews.llvm.org/D7762
llvm-svn: 230022
Benjamin Kramer [Fri, 20 Feb 2015 16:19:28 +0000 (16:19 +0000)]
Base isPodLike on is_trivially_copyable for GCC 5 and MSVC
It would be nice to get rid of the version checks here, but that will
have to wait until libstdc++ is upgraded to 5.0 everywhere ...
llvm-svn: 230021
Kit Barton [Fri, 20 Feb 2015 15:54:58 +0000 (15:54 +0000)]
I incorrectly marked the VORC instruction as isCommutable when I added it.
This fix removes the VORC instruction definition from the isCommutable block.
Phabricator review: http://reviews.llvm.org/D7772
llvm-svn: 230020
Timur Iskhodzhanov [Fri, 20 Feb 2015 15:45:51 +0000 (15:45 +0000)]
[ASan] Make the argument of '__sanitizer_annotate_contiguous_container' is not aligned error message easier to understand
llvm-svn: 230019
Timur Iskhodzhanov [Fri, 20 Feb 2015 15:34:16 +0000 (15:34 +0000)]
[ASan/Win] Work around PR22545 - unregister globals when using the MD runtime
llvm-svn: 230018
Igor Laevsky [Fri, 20 Feb 2015 15:28:35 +0000 (15:28 +0000)]
Generalize statepoint lowering to use ImmutableStatepoint. Move statepoint lowering into a separate function 'LowerStatepoint' which uses ImmutableStatepoint instead of a CallInst. Also related utility functions are changed to receive ImmutableCallSite.
Differential Revision: http://reviews.llvm.org/D7756
llvm-svn: 230017
Benjamin Kramer [Fri, 20 Feb 2015 15:11:55 +0000 (15:11 +0000)]
Constants.cpp: Only read 32 bits for float.
Otherwise we'll discard the wrong half of a uint64_t on big-endian systems.
llvm-svn: 230016
Rui Ueyama [Fri, 20 Feb 2015 14:57:04 +0000 (14:57 +0000)]
Remove redundant "explicit".
llvm-svn: 230015
John Thompson [Fri, 20 Feb 2015 14:28:10 +0000 (14:28 +0000)]
Deleted module-map-checker, as it's been folded into modularize.
llvm-svn: 230014
NAKAMURA Takumi [Fri, 20 Feb 2015 14:24:49 +0000 (14:24 +0000)]
Constants.cpp: getElementAsAPFloat(): Don't handle constant value via host's float/double, just handle with APInt/APFloat.
x87 FPU didn't keep SNAN, but demoted to QNAN.
llvm-svn: 230013
Benjamin Kramer [Fri, 20 Feb 2015 14:00:58 +0000 (14:00 +0000)]
RewriteStatepointsForGC: Move details into anonymous namespaces. NFC.
While there reduce the number of duplicated std::map lookups.
llvm-svn: 230012
Daniel Jasper [Fri, 20 Feb 2015 13:47:38 +0000 (13:47 +0000)]
clang-format: [js] Support template strings.
Merge template strings (marked by backticks ``).
Do not format any contents of template strings.
Patch by Martin Probst. Thank you.
llvm-svn: 230011
Benjamin Kramer [Fri, 20 Feb 2015 13:16:05 +0000 (13:16 +0000)]
Make the static instance of None just const.
This way there shouldn't be any unused variable warnings.
llvm-svn: 230010
Benjamin Kramer [Fri, 20 Feb 2015 13:15:49 +0000 (13:15 +0000)]
Wrap recursive function only used in assert in #ifndef NDEBUG.
Avoids unused function warnings in Release builds.
llvm-svn: 230009
Ilia K [Fri, 20 Feb 2015 13:07:41 +0000 (13:07 +0000)]
Add -symbol-list-lines command (MI)
Summary:
Add -symbol-list-lines command + test.
All test passed on OS X.
Reviewers: emaste, abidh, clayborg
Reviewed By: clayborg
Subscribers: lldb-commits, clayborg, abidh, emaste
Differential Revision: http://reviews.llvm.org/D7768
llvm-svn: 230008
Jean-Daniel Dupas [Fri, 20 Feb 2015 11:57:06 +0000 (11:57 +0000)]
[Mach-O] Remove redundant allocator
llvm-svn: 230007
Manuel Klimek [Fri, 20 Feb 2015 11:44:41 +0000 (11:44 +0000)]
Add -fno-implicit-modules.
If this flag is set, we error out when a module build is required. This is
useful in environments where all required modules are passed via -fmodule-file.
llvm-svn: 230006
Pavel Labath [Fri, 20 Feb 2015 11:14:59 +0000 (11:14 +0000)]
Refactor OptionValue::SetValueFromCString to use llvm::StringRef
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D7676
llvm-svn: 230005
Chandler Carruth [Fri, 20 Feb 2015 10:47:28 +0000 (10:47 +0000)]
[x86] Switching the shuffle equivalence test to a variadic template was
the wrong answer. We also got initializer lists which are *way* cleaner
for this kind of thing. Let's use those and make this a normal, boring
functionn accepting ArrayRef.
llvm-svn: 230004
Hafiz Abid Qadeer [Fri, 20 Feb 2015 10:20:05 +0000 (10:20 +0000)]
Reduce number of threads in lldb-mi.
LLDB-mi have 3 threads.
1. Wait for input.
2. Process commands.
3. Process events.
This revision merges 1 & 2. Same thread waits on input and then process the
command. This way, no synchronization is needed between first and 2nd. Also it is
easy to check when to exit.
A lot of code will redundant and will be cleaned up gradually.
All lldb-mi tests pass with gcc and clang as test compiler. Also did minimal testing
on command line and works ok. The "quit" and "-gdb-exit" command close the application
without needing any further return.
Reviewed in http://reviews.llvm.org/D7746.
llvm-svn: 230003
Mohit K. Bhakkad [Fri, 20 Feb 2015 09:32:45 +0000 (09:32 +0000)]
[TSan][MIPS64] Fix few more test cases for MIPS64
Patch by Sagar Thakur
Reviewers: dvyukov, samsonov, kcc.
Subscribers: dsanders, mohit.bhakkad, Anand.Takale, llvm-commits.
Differential Revision: http://reviews.llvm.org/D7290
llvm-svn: 230002
Eric Christopher [Fri, 20 Feb 2015 08:42:34 +0000 (08:42 +0000)]
Fix wording and grammar in Mips subtarget options.
llvm-svn: 230001
Eric Christopher [Fri, 20 Feb 2015 08:39:06 +0000 (08:39 +0000)]
Get the cached subtarget off the MachineFunction rather than
inquiring for a new one from the TargetMachine.
llvm-svn: 230000
Eric Christopher [Fri, 20 Feb 2015 08:24:37 +0000 (08:24 +0000)]
Get the cached subtarget off the MachineFunction rather than
inquiring for a new one from the TargetMachine.
llvm-svn: 229999
Eric Christopher [Fri, 20 Feb 2015 08:24:34 +0000 (08:24 +0000)]
Get the cached subtarget off the MachineFunction rather than
inquiring for a new one from the TargetMachine.
llvm-svn: 229998
Justin Bogner [Fri, 20 Feb 2015 08:19:43 +0000 (08:19 +0000)]
Driver: Fix an incorrect use of llvm::None
This function returns a bool, so llvm::None doesn't make sense here.
llvm-svn: 229997
Eric Christopher [Fri, 20 Feb 2015 08:01:55 +0000 (08:01 +0000)]
Save the MachineFunction in startFunction so that we can use it for
lookups of the subtarget later.
llvm-svn: 229996
Eric Christopher [Fri, 20 Feb 2015 08:01:52 +0000 (08:01 +0000)]
Use the cached subtarget from the MachineFunction rather than
doing a lookup on the TargetMachine.
llvm-svn: 229995
Eric Christopher [Fri, 20 Feb 2015 07:32:59 +0000 (07:32 +0000)]
Make the TargetMachine::getSubtarget that takes a Function argument
take a reference to match the getSubtargetImpl that takes a Function
argument.
llvm-svn: 229994
Justin Bogner [Fri, 20 Feb 2015 07:28:28 +0000 (07:28 +0000)]
Disallow implicit conversions from None to integer types
This fixes an error introduced in r228934 where None was converted to
an int instead of the int being converted to an Optional as intended.
We make that sort of mistake a compile error by changing NoneType into
a scoped enum.
Finally, provide a static NoneType called None to avoid forcing all
users to spell it NoneType::None.
llvm-svn: 229980
Nick Lewycky [Fri, 20 Feb 2015 07:17:40 +0000 (07:17 +0000)]
Fix build with gcc. This has a -Wsequence-point error on 'MII', which is a good point.
llvm-svn: 229979
Eric Christopher [Fri, 20 Feb 2015 07:16:19 +0000 (07:16 +0000)]
Remove more uses of TargetMachine::getSubtargetImpl from the
AsmPrinter.
getSubtargetInfo now asserts that the MachineFunction exists.
Debug printing of register naming now uses the register info
from MCAsmInfo as that's unchanging.
llvm-svn: 229978
Nick Lewycky [Fri, 20 Feb 2015 07:16:17 +0000 (07:16 +0000)]
Fix build in release mode, -Wunused-variable on this lambda function used only in an assert.
llvm-svn: 229977
Nick Lewycky [Fri, 20 Feb 2015 07:14:02 +0000 (07:14 +0000)]
Fix build in release mode, four cases of -Wunused-variable.
llvm-svn: 229976
Nick Lewycky [Fri, 20 Feb 2015 07:05:56 +0000 (07:05 +0000)]
Remove carriage returns.
llvm-svn: 229975
Eric Christopher [Fri, 20 Feb 2015 06:59:48 +0000 (06:59 +0000)]
AsmPrinter::doFinalization is at the module level and so doesn't
have access to a target specific subtarget info. Grab the module
level MCSubtargetInfo for the JumpInstrTable output stubs.
llvm-svn: 229974
Lang Hames [Fri, 20 Feb 2015 06:48:29 +0000 (06:48 +0000)]
[Orc] Add a new JITSymbol constructor to build a symbol from an existing address.
This constructor is more efficient for symbols that have already been emitted,
since it avoids the construction/execution of a std::function.
Update the ObjectLinkingLayer to use this new constructor where possible.
llvm-svn: 229973
Mohit K. Bhakkad [Fri, 20 Feb 2015 06:42:41 +0000 (06:42 +0000)]
[TSan][MIPS] Adding support for MIPS64
Patch by Sagar Thakur
Reviewers: dvyukov, samsonov, petarj, kcc, dsanders.
Subscribers: mohit.bhakkad, Anand.Takale, llvm-commits.
Differential Revision: http://reviews.llvm.org/D6291
llvm-svn: 229972
Eric Christopher [Fri, 20 Feb 2015 06:35:21 +0000 (06:35 +0000)]
Remove the MCInstrInfo cached variable as it was only used in a
single place and replace calls to getSubtargetImpl with calls
to get the subtarget from the MachineFunction where valid.
llvm-svn: 229971
David Blaikie [Fri, 20 Feb 2015 06:28:38 +0000 (06:28 +0000)]
Fix -Wunused-variable warning in non-asserts build, and optimize a little bit while I'm here.
llvm-svn: 229970
Larisse Voufo [Fri, 20 Feb 2015 06:17:20 +0000 (06:17 +0000)]
Add self to CREDITS.TXT
llvm-svn: 229969
Larisse Voufo [Fri, 20 Feb 2015 06:13:05 +0000 (06:13 +0000)]
More on adding sized deallocation functions in libc++: Continuing from r229281, this adds version guards and test cases.
llvm-svn: 229968
David Majnemer [Fri, 20 Feb 2015 05:10:06 +0000 (05:10 +0000)]
LinkerScript: Remove leaks in the parser
LinkerScript AST nodes are never destroyed which means that their
std::vector members will never be destroyed.
Instead, allocate the operand list itself in the Parser's
BumpPtrAllocator. This ensures that the storage will be destroyed along
with the nodes when the Parser is destroyed.
llvm-svn: 229967
Hal Finkel [Fri, 20 Feb 2015 05:08:21 +0000 (05:08 +0000)]
[PowerPC] Loop Data Prefetching for the BG/Q
The IBM BG/Q supercomputer's A2 cores have a hardware prefetching unit, the
L1P, but it does not prefetch directly into the A2's L1 cache. Instead, it
prefetches into its own L1P buffer, and the latency to access that buffer is
significantly higher than that to the L1 cache (although smaller than the
latency to the L2 cache). As a result, especially when multiple hardware
threads are not actively busy, explicitly prefetching data into the L1 cache is
advantageous.
I've been using this pass out-of-tree for data prefetching on the BG/Q for well
over a year, and it has worked quite well. It is enabled by default only for
the BG/Q, but can be enabled for other cores as well via a command-line option.
Eventually, we might want to add some TTI interfaces and move this into
Transforms/Scalar (there is nothing particularly target dependent about it,
although only machines like the BG/Q will benefit from its simplistic
strategy).
llvm-svn: 229966
Richard Smith [Fri, 20 Feb 2015 04:45:22 +0000 (04:45 +0000)]
PR22435: Correctly implement tiebreaker for reference ordering in function
template partial ordering rules. This rule applies per pair of types being
compared, not per pair of function templates being compared.
llvm-svn: 229965
Chandler Carruth [Fri, 20 Feb 2015 04:25:04 +0000 (04:25 +0000)]
[x86] Remove the old vector shuffle lowering code and its flag.
The new shuffle lowering has been the default for some time. I've
enabled the new legality testing by default with no really blocking
regressions. I've fuzz tested this very heavily (many millions of fuzz
test cases have passed at this point). And this cleans up a ton of code.
=]
Thanks again to the many folks that helped with this transition. There
was a lot of work by others that went into the new shuffle lowering to
make it really excellent.
In case you aren't using a diff algorithm that can handle this:
X86ISelLowering.cpp: 22 insertions(+), 2940 deletions(-)
llvm-svn: 229964
Chandler Carruth [Fri, 20 Feb 2015 03:59:35 +0000 (03:59 +0000)]
[x86] Now that the new vector shuffle legality is enabled and everything
is going well, remove the flag and the code for the old legality tests.
This is the first step toward removing the entire old vector shuffle
lowering. *Much* more code to delete coming up next.
llvm-svn: 229963
Filipe Cabecinhas [Fri, 20 Feb 2015 03:41:07 +0000 (03:41 +0000)]
Make FileCheck be a common dependency, not an ASan one.
Summary:
It still gets picked up by ASan, but it also gets picked up by the other
test suites.
Otherwise, some test suites (e.g: UBSan) would complain they had no
dependencies, and wouldn't run.
Reviewers: samsonov, eugenis
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D7740
llvm-svn: 229962
Rui Ueyama [Fri, 20 Feb 2015 03:35:59 +0000 (03:35 +0000)]
PECOFF: Fix base relocation for ImageBase.
This is yet another edge case of base relocation for symbols. Absolute
symbols are in general not target of base relocation because absolute
atom is a way to point to a specific memory location. In r229816, I
removed entries for absolute atoms from the base relocation table
(so that they won't be fixed by the loader).
However, there was one exception -- ImageBase. ImageBase points to the
start address of the current image in memory. That needs to be fixed up
at load time. This patch is to treat the symbol in a special manner.
llvm-svn: 229961
Duncan P. N. Exon Smith [Fri, 20 Feb 2015 03:17:58 +0000 (03:17 +0000)]
Bitcode: Stop assuming non-null fields
When writing the bitcode serialization for the new debug info hierarchy,
I assumed two fields would never be null.
Drop that assumption, since it's brittle (and crashes the
`BitcodeWriter` if wrong), and is a check better left for the verifier
anyway. (No need for a bitcode upgrade here, since the new hierarchy is
still not in place.)
The fields in question are `MDCompileUnit::getFile()` and
`MDDerivedType::getBaseType()`, the latter of which isn't null in
test/Transforms/Mem2Reg/ConvertDebugInfo2.ll (see !14, a pointer to
nothing). While the testcase might have bitrotted, there's no reason
for the bitcode format to rely on non-null for metadata operands.
This also fixes a bug in `AsmWriter` where if the `file:` is null it
isn't emitted (caught by the double-round trip in the testcase I'm
adding) -- this is a required field in `LLParser`.
I'll circle back to ConvertDebugInfo2. Once the specialized nodes are
in place, I'll be trying to turn the debug info verifier back on by
default (in the newer module pass form committed r206300) and throwing
more logic in there. If the testcase has bitrotted (as opposed to me
not understanding the schema correctly) I'll fix it then.
llvm-svn: 229960
Hal Finkel [Fri, 20 Feb 2015 03:05:53 +0000 (03:05 +0000)]
[InstCombine] Remove unnecessary variable indexing into single-element arrays
This change addresses a deficiency pointed out in PR22629. To copy from the bug
report:
[from the bug report]
Consider this code:
int f(int x) {
int a[] = {12};
return a[x];
}
GCC knows to optimize this to
movl $12, %eax
ret
The code generated by recent Clang at -O3 is:
movslq %edi, %rax
movl .L_ZZ1fiE1a(,%rax,4), %eax
retq
.L_ZZ1fiE1a:
.long 12 # 0xc
[end from the bug report]
This definitely seems worth fixing. I've also seen this kind of code before (as
the base case of generic vector wrapper templates with one element).
The general idea is to look at the GEP feeding a load or a store, which has
some variable as its first non-zero index, and determine if that index must be
zero (or else an out-of-bounds access would occur). We can do this for allocas
and globals with constant initializers where we know the maximum size of the
underlying object. When we find such a GEP, we create a new one for the memory
access with that first variable index replaced with a constant zero.
Even if we can't eliminate the memory access (and sometimes we can't), it is
still useful because it removes unnecessary indexing calculations.
llvm-svn: 229959
Chandler Carruth [Fri, 20 Feb 2015 03:05:47 +0000 (03:05 +0000)]
[x86] Make the new vector shuffle legality test on by default, which
reflects the fact that the x86 backend can in fact lower any shuffle you
want it to with reasonably high code quality.
My recent work on the new vector shuffle has made this regress *very*
little. The diff in the test cases makes me very, very happy.
llvm-svn: 229958