Sanjay Patel [Thu, 7 Apr 2016 14:29:05 +0000 (14:29 +0000)]
make __builtin_isfinite more efficient (PR27145)
isinf (is infinite) and isfinite should be implemented with the same function
except we change the comparison operator.
See PR27145 for more details:
https://llvm.org/bugs/show_bug.cgi?id=27145
Ref: forked off of the discussion in D18513.
Differential Revision: http://reviews.llvm.org/D18648
llvm-svn: 265675
Marshall Clow [Thu, 7 Apr 2016 14:24:16 +0000 (14:24 +0000)]
Added a noexcept test
llvm-svn: 265674
Rafael Espindola [Thu, 7 Apr 2016 14:22:09 +0000 (14:22 +0000)]
Don't create dynamic relocs for discarded .eh_frame entries.
This requires knowing input section offsets in output sections before
scanRelocs. This is generally a good thing and should allow further
simplifications in the creation of dynamic relocations.
llvm-svn: 265673
Marshall Clow [Thu, 7 Apr 2016 14:20:31 +0000 (14:20 +0000)]
Fix bug #27260 - add missing swap(reference, reference) to vector<bool>.
llvm-svn: 265672
Etienne Bergeron [Thu, 7 Apr 2016 14:18:53 +0000 (14:18 +0000)]
[clang-tidy] Fix FP with readability-redundant-string-init for default arguments
Summary:
Clang-tidy is reporting a warning of redundant string initialisation
on a string parameter initialized with empty string.
See bug: 27087
The reported example is:
```
#include <string>
void fn(std::string a = "");
```
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D18829
llvm-svn: 265671
Valery Pykhtin [Thu, 7 Apr 2016 13:41:51 +0000 (13:41 +0000)]
[AMDGPU] fix readlane/readfirstlane src vgpr operand type.
For VGPR_32 operand disassembler expects a VGPR register encoded as 0..255 (enum8 src operand).
readfirstlane/readline actually has enum9 operand and this change fixes VGPR_32 to VS_32 (enum9 encoding).
Differential Revision: http://reviews.llvm.org/D18696
llvm-svn: 265670
Dmitry Polukhin [Thu, 7 Apr 2016 13:18:43 +0000 (13:18 +0000)]
Fix test/Assembler/ifunc-asm.ll test on hexagon-elf bots
Temporary disable llc test, it seems that such test should be in some
other directory.
llvm-svn: 265669
Alexey Bataev [Thu, 7 Apr 2016 12:45:37 +0000 (12:45 +0000)]
[OPENMP 4.0] Parsing/sema analysis for 'simdlen' clause in 'declare simd'
construct.
OpenMP 4.0 defines '#pragma omp declare simd' construct that may have
associated 'simdlen' clause with constant positive expression as an
argument:
simdlen(<const_expr>)
Patch adds parsin and semantic analysis for simdlen clause.
llvm-svn: 265668
Dmitry Polukhin [Thu, 7 Apr 2016 12:32:19 +0000 (12:32 +0000)]
[GCC] Attribute ifunc support in llvm
This patch add support for GCC attribute((ifunc("resolver"))) for
targets that use ELF as object file format. In general ifunc is a
special kind of function alias with type @gnu_indirect_function. Patch
for Clang http://reviews.llvm.org/D15524
Differential Revision: http://reviews.llvm.org/D15525
llvm-svn: 265667
Kuba Brecka [Thu, 7 Apr 2016 12:10:28 +0000 (12:10 +0000)]
[tsan] Remove long sleeps from fork tests
On one of our testing machines, we're running the tests under heavy load, and especially in the fork-based TSan tests, we're seeing timeouts when a test uses sleep(10), assuming that calling fork() on another thread will finish sooner than that. This patch removes a timeout and makes another one longer.
Differential Revision: http://reviews.llvm.org/D18476
llvm-svn: 265666
Kuba Brecka [Thu, 7 Apr 2016 12:05:09 +0000 (12:05 +0000)]
[tsan] Add support for OS X OSAtomic* functions
OS X provides atomic functions in libkern/OSAtomic.h. These provide atomic guarantees and they have alternatives which have barrier semantics. This patch adds proper TSan support for the functions from libkern/OSAtomic.h.
Differential Revision: http://reviews.llvm.org/D18500
llvm-svn: 265665
Rafael Espindola [Thu, 7 Apr 2016 12:02:42 +0000 (12:02 +0000)]
Add a test for the offset of dynamic relocations.
I found that a patch I am working on would have broken this and no
existing test found it.
llvm-svn: 265664
Kuba Brecka [Thu, 7 Apr 2016 11:59:36 +0000 (11:59 +0000)]
[tsan] Add TSan __tsan_atomic* functions to tsan_interface.h
To avoid using the public header (tsan_interface_atomic.h), which has different data types, let's add all the __tsan_atomic* functions to tsan_interface.h.
Differential Revision: http://reviews.llvm.org/D18543
llvm-svn: 265663
Kuba Brecka [Thu, 7 Apr 2016 11:52:51 +0000 (11:52 +0000)]
[tsan] Add interceptors for dispatch_apply
Adding an interceptor with two more release+acquire pairs to avoid false positives with dispatch_apply.
Differential Revision: http://reviews.llvm.org/D18722
llvm-svn: 265662
Kuba Brecka [Thu, 7 Apr 2016 11:47:11 +0000 (11:47 +0000)]
[tsan] Add XPC support (OS X)
XPC APIs have async callbacks, and we need some more happen-before edges to avoid false positives. This patch add them, plus a test case (sorry for the long boilerplate code, but XPC just needs all that).
Differential Revision: http://reviews.llvm.org/D18493
llvm-svn: 265661
Kuba Brecka [Thu, 7 Apr 2016 11:38:53 +0000 (11:38 +0000)]
[tsan] Add support for dispatch event sources
GCD has APIs for event sources, we need some more release-acquire pairs to avoid false positives in TSan.
Differential Revision: http://reviews.llvm.org/D18515
llvm-svn: 265660
Kuba Brecka [Thu, 7 Apr 2016 11:33:44 +0000 (11:33 +0000)]
[tsan] Fix synchronization in dispatch_sync
In the interceptor for dispatch_sync, we're currently missing synchronization between the callback and the code *after* the call to dispatch_sync. This patch fixes this by adding an extra release+acquire pair to dispatch_sync() and similar APIs. Added a testcase.
Differential Revision: http://reviews.llvm.org/D18502
llvm-svn: 265659
Kuba Brecka [Thu, 7 Apr 2016 11:31:02 +0000 (11:31 +0000)]
[tsan] Fix Darwin tests (missing FileCheck's)
A little embarrassing, but we're missing the call to FileCheck in several Darwin tests. Let's fix this.
Differential Revision: http://reviews.llvm.org/D18503
llvm-svn: 265658
NAKAMURA Takumi [Thu, 7 Apr 2016 11:30:06 +0000 (11:30 +0000)]
InlineSpiller.cpp: Escap \@ in r265547. [-Wdocumentation]
llvm-svn: 265657
Kuba Brecka [Thu, 7 Apr 2016 11:01:05 +0000 (11:01 +0000)]
Enabling AddressSanitizer tests, they should pass now (and this time I mean it).
llvm-svn: 265656
Alexander Kornienko [Thu, 7 Apr 2016 10:17:23 +0000 (10:17 +0000)]
[docs] Update version (http://llvm.org/PR27253)
llvm-svn: 265655
Benjamin Kramer [Thu, 7 Apr 2016 10:14:54 +0000 (10:14 +0000)]
Move class into an anonymous namespace. NFC.
llvm-svn: 265654
Benjamin Kramer [Thu, 7 Apr 2016 10:10:09 +0000 (10:10 +0000)]
Make helper functions static. NFC.
llvm-svn: 265653
Kuba Brecka [Thu, 7 Apr 2016 10:07:45 +0000 (10:07 +0000)]
Simplify the ASan expression (follow-up for the previous commit, r265651).
llvm-svn: 265652
Kuba Brecka [Thu, 7 Apr 2016 10:02:43 +0000 (10:02 +0000)]
Tentative fix (add `extern "C"` declarations to expression prefix) and printing evaluation errors for AddressSanitizer (both MemoryHistoryASan.cpp and AddressSanitizerRuntime.cpp). Hopefully this will make the ASan testcases pass or at least the failure should be easier to diagnose.
llvm-svn: 265651
Pavel Labath [Thu, 7 Apr 2016 09:25:04 +0000 (09:25 +0000)]
Enable TestDebugBreak on x86_64 as well
Test passes there, and this would have helped me catch the snafu in the previous commit.
llvm-svn: 265650
Valery Pykhtin [Thu, 7 Apr 2016 08:38:20 +0000 (08:38 +0000)]
fix r265645: target dependent printf formatting flags.
llvm-svn: 265649
Jeroen Ketema [Thu, 7 Apr 2016 08:36:13 +0000 (08:36 +0000)]
[CMake] Check for sys/types.h in config-ix.cmake
`sys/types.h` has a related define in `config.h.cmake`, but was never
checked for in CMake. Sync this.
Differential Revision: http://reviews.llvm.org/D18825
llvm-svn: 265648
Pavel Labath [Thu, 7 Apr 2016 08:16:10 +0000 (08:16 +0000)]
Revert "Reduce code duplication in ProcessGDBRemote"
In turns out this does make a functional change, in case when the inferior hits an int3 that was
not placed by the debugger. Backing out for now.
llvm-svn: 265647
Simon Pilgrim [Thu, 7 Apr 2016 07:52:45 +0000 (07:52 +0000)]
[X86][SSE] Add support for VZEXT constant folding
llvm-svn: 265646
Valery Pykhtin [Thu, 7 Apr 2016 07:24:01 +0000 (07:24 +0000)]
[AMDGPU] llvm-objdump: Minimal HSA Code Object disassembler support.
Reenable reverted r265550 with endianness issue fixed. Variables of
endian-aware types such as ulittle32_t should be explicitly casted
to their natural equivalent types before passing it as vararg to
printf like functions (format in my case). Added lit config file
depending on AMDGPU target as the testcase uses assembler.
Differential revision: http://reviews.llvm.org/D16998
llvm-svn: 265645
Saleem Abdulrasool [Thu, 7 Apr 2016 06:51:10 +0000 (06:51 +0000)]
Symbol: fix build
TargetOptions is ambiguous due to a definition in LLVM and in clang. This was
exposed by SVN r265640. Update to fix the build against the newer revision.
llvm-svn: 265644
Amaury Sechet [Thu, 7 Apr 2016 06:35:00 +0000 (06:35 +0000)]
[BlockPlacement] Remove an unnecessary continue
NFC.
llvm-svn: 265643
Amaury Sechet [Thu, 7 Apr 2016 06:34:47 +0000 (06:34 +0000)]
[MBP] Remove an unused function parameter
NFC.
llvm-svn: 265642
Amaury Sechet [Thu, 7 Apr 2016 05:56:20 +0000 (05:56 +0000)]
Do some refactoring in the LLVM C API echo test to remove duplication. NFC
llvm-svn: 265641
Saleem Abdulrasool [Thu, 7 Apr 2016 05:41:11 +0000 (05:41 +0000)]
Basic: thread CodeGenOptions into TargetInfo
This threads CodeGenOptions into the TargetInfo hierarchy. This is motivated by
ARM which can change some target information based on the EABI selected
(-meabi). Similar options exist for other platforms (e.g. MIPS) and thus is
generally useful. NFC.
llvm-svn: 265640
Wei Mi [Thu, 7 Apr 2016 05:27:17 +0000 (05:27 +0000)]
Fix the sanitizer bootstrap error in r265547.
The iterators of SmallPtrSet SpillsInSubTreeMap[Child].first may be
invalidated when SpillsInSubTreeMap grows. Rearrange the code to
ensure the grow of SpillsInSubTreeMap only happens before getting
the iterators of the SmallPtrSet.
llvm-svn: 265639
Amaury Sechet [Thu, 7 Apr 2016 04:28:40 +0000 (04:28 +0000)]
Revert "[BlockPlacement] Remove an unnecessary continue" and "[MBP] Remove an unused function parameter"
llvm-svn: 265638
Duncan P. N. Exon Smith [Thu, 7 Apr 2016 02:10:50 +0000 (02:10 +0000)]
Revert "ValueMapper: Make LocalAsMetadata match function-local Values"
This reverts commit r265631, since it caused bot failures:
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/3256
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-42vma/builds/7272
Looks like something is depending on the old behaviour. I'll try to
track it down and recommit.
llvm-svn: 265637
Ahmed Bougacha [Thu, 7 Apr 2016 02:07:10 +0000 (02:07 +0000)]
[X86] Reuse EFLAGS and form LOCKed ops when only user is SETCC.
Re-apply r265450 which caused PR27245 and was reverted in r265559
because of a wrong generalization: the fetch_and_add->add_and_fetch
combine only works in specific, but pretty common, cases:
(icmp slt x, 0) -> (icmp sle (add x, 1), 0)
(icmp sge x, 0) -> (icmp sgt (add x, 1), 0)
(icmp sle x, 0) -> (icmp slt (sub x, 1), 0)
(icmp sgt x, 0) -> (icmp sge (sub x, 1), 0)
Original Message:
We only generate LOCKed versions of add/sub when the result is unused.
It often happens that the result is used, but only by a comparison. We
can optimize those out by reusing EFLAGS, which lets us use the proper
instructions, instead of having to fallback to LXADD.
Instead of doing this as an MI peephole (as we do for the other
non-LOCKed (really, non-MR) forms), do it in ISel. It becomes quite
tricky later.
This also makes it eventually possible to stop expanding and/or/xor
if the only user is an icmp (also see D18141).
This uses the LOCK ISD opcodes added by r262244.
Differential Revision: http://reviews.llvm.org/D17633
llvm-svn: 265636
Ahmed Bougacha [Thu, 7 Apr 2016 02:06:53 +0000 (02:06 +0000)]
[X86] Refresh and tweak EFLAGS reuse tests. NFC.
The non-1 and EQ/NE tests were misguided.
llvm-svn: 265635
Sean Silva [Thu, 7 Apr 2016 01:58:14 +0000 (01:58 +0000)]
Don't use PATH_MAX.
This is a SmallVector anyway, and so the exact size doesn't matter.
clang\lib\Frontend\ModuleDependencyCollector.cpp(83) : error C2065: 'PATH_MAX' : undeclared identifier
clang\lib\Frontend\ModuleDependencyCollector.cpp(83) : error C2975: 'InternalLen' : invalid template argument for 'llvm::SmallString', expected compile-time constant expression
llvm\include\llvm/ADT/SmallString.h(24) : see declaration of 'InternalLen'
llvm-svn: 265634
Duncan P. N. Exon Smith [Thu, 7 Apr 2016 01:22:45 +0000 (01:22 +0000)]
ValueMapper: Allow RF_IgnoreMissingLocals and RF_NullMapMissingGlobalValues
Remove the assertion that disallowed the combination, since
RF_IgnoreMissingLocals should have no effect on globals. As it happens,
RF_NullMapMissingGlobalValues asserted in MapValue(Constant*,...), so I
also changed a cast to a cast_or_null to get my test passing.
llvm-svn: 265633
Bruno Cardoso Lopes [Thu, 7 Apr 2016 01:12:18 +0000 (01:12 +0000)]
[CrashReproducer] Use toUppercase from include/clang/Basic/CharInfo.h
Use toUppercase instead of ::toupper()
llvm-svn: 265632
Duncan P. N. Exon Smith [Thu, 7 Apr 2016 01:08:39 +0000 (01:08 +0000)]
ValueMapper: Make LocalAsMetadata match function-local Values
Start treating LocalAsMetadata similarly to function-local members of
the Value hierarchy in MapValue and MapMetadata.
- Don't memoize them.
- Return nullptr if they are missing.
This also cleans up ConstantAsMetadata to stop listening to the
RF_IgnoreMissingLocals flag.
llvm-svn: 265631
Bruno Cardoso Lopes [Thu, 7 Apr 2016 01:04:09 +0000 (01:04 +0000)]
[CrashReproducer] Change std::toupper to ::toupper
Attempt to fix windows bots
llvm-svn: 265630
Quentin Colombet [Thu, 7 Apr 2016 00:39:29 +0000 (00:39 +0000)]
[AArch64] Teach RegisterBankInfo about the CC register bank.
We need to cover each register class with a register bank.
llvm-svn: 265629
Duncan P. N. Exon Smith [Thu, 7 Apr 2016 00:26:43 +0000 (00:26 +0000)]
IR: RF_IgnoreMissingValues => RF_IgnoreMissingLocals, NFC
Clarify what this RemapFlag actually means.
- Change the flag name to match its intended behaviour.
- Clearly document that it's not supposed to affect globals.
- Add a host of FIXMEs to indicate how to fix the behaviour to match
the intent of the flag.
RF_IgnoreMissingLocals should only affect the behaviour of
RemapInstruction for function-local operands; namely, for operands of
type Argument, Instruction, and BasicBlock. Currently, it is *only*
passed into RemapInstruction calls (and the transitive MapValue calls
that it makes).
When I split Metadata from Value I didn't understand the flag, and I
used it in a bunch of places for "global" metadata.
This commit doesn't have any functionality change, but prepares to
cleanup MapMetadata and MapValue.
llvm-svn: 265628
Mike Aizatsky [Thu, 7 Apr 2016 00:23:02 +0000 (00:23 +0000)]
[sancov] removing flaky test case (win)
llvm-svn: 265627
Quentin Colombet [Thu, 7 Apr 2016 00:14:30 +0000 (00:14 +0000)]
[AArch64] Teach RegisterBankInfo about the mapping of register classes
on register banks.
llvm-svn: 265626
Michael Zolotukhin [Thu, 7 Apr 2016 00:09:42 +0000 (00:09 +0000)]
Follow-up for r265605: don't mutate vector we're iterating.
llvm-svn: 265625
Quentin Colombet [Thu, 7 Apr 2016 00:07:50 +0000 (00:07 +0000)]
[RegisterBankInfo] Implement a target independent version of
getInstrMapping.
This implementation requires that the target implemented
getRegBankFromRegClass.
Indeed, the implementation uses the register classes for the encoding
constraints for the instructions to deduce the mapping of a value.
llvm-svn: 265624
Hans Wennborg [Thu, 7 Apr 2016 00:05:49 +0000 (00:05 +0000)]
Re-commit r265039 "[X86] Merge adjacent stack adjustments in eliminateCallFramePseudoInstr (PR27140)"
Third time's the charm? The previous attempt (r265345) caused ASan test
failures on X86, as broken CFI caused stack traces to not work.
This version of the patch makes sure not to merge with stack adjustments
that have CFI, and to not add merged instructions' offests to the CFI
about to be generated.
This is already covered by the lit tests; I just got the expectations
wrong previously.
llvm-svn: 265623
Bruno Cardoso Lopes [Thu, 7 Apr 2016 00:00:57 +0000 (00:00 +0000)]
[CrashReproducer] Setup 'case-sensitive' in YAML files.
The crash reproducer was not setting up case sensitivity in the
VFS yaml files, which defaults to true. Make the crash reproducer
explicitly set that flag based on the case sensitivity of the .cache
path where vfs and modules are dumped.
llvm-svn: 265622
Bruno Cardoso Lopes [Thu, 7 Apr 2016 00:00:42 +0000 (00:00 +0000)]
[CrashReproducer] Move ModuleDependencyCollector method around. NFC
llvm-svn: 265621
Quentin Colombet [Wed, 6 Apr 2016 23:59:53 +0000 (23:59 +0000)]
[RegisterBankInfo] Add an helper function to get the size of a register.
The previous method to get the size was too simple and could fail for
physical registers.
llvm-svn: 265620
Rui Ueyama [Wed, 6 Apr 2016 23:55:43 +0000 (23:55 +0000)]
Ignore --warn-execstack.
Stack is not executable by default in LLD-built executables unless
you pass -z execstack option. So --warn-execstack option does not make
sense to us.
llvm-svn: 265619
Justin Lebar [Wed, 6 Apr 2016 23:46:40 +0000 (23:46 +0000)]
Fix a race condition in support library ThreadPool.
By running TSAN on the ThreadPool unit tests it was discovered that the
threads in the pool can pop tasks off the queue at the same time the
"wait" routine is trying to check if the task queue is empty. This patch
fixes this problem by checking for active threads in the waiter before
checking whether the queue is empty.
Patch by Jason Henline.
Differential Revision: http://reviews.llvm.org/D18811
Reviewers: joker.eph, jlebar
llvm-svn: 265618
JF Bastien [Wed, 6 Apr 2016 23:37:36 +0000 (23:37 +0000)]
NFC: use AtomicOrdering isStrongerThan
Summary: As discussed in D18775.
Reviewers: jyknight
Differential Revision: http://reviews.llvm.org/D18840
llvm-svn: 265617
Manman Ren [Wed, 6 Apr 2016 23:28:26 +0000 (23:28 +0000)]
Keep -fmodule-implementation-of as an alias of -fmodule-name.
This helps us transitioning to -fmodule-name. Once the transitioning is done,
we can remove this alias.
rdar://
24800983
llvm-svn: 265616
Mike Aizatsky [Wed, 6 Apr 2016 23:24:37 +0000 (23:24 +0000)]
[sancov] enabling coverage edge pruning by default.
Differential Revision: http://reviews.llvm.org/D18844
llvm-svn: 265615
Mike Aizatsky [Wed, 6 Apr 2016 23:24:16 +0000 (23:24 +0000)]
[sancov] enabling coverage edge pruning by default.
Differential Revision: http://reviews.llvm.org/D18845
llvm-svn: 265614
Sean Silva [Wed, 6 Apr 2016 23:18:09 +0000 (23:18 +0000)]
Another place for CMAKE_HOST_UNIX
If we don't create the target, don't try to add it as a dependency.
After r265595, we were only creating the SanitizerLintCheck when
`CMAKE_HOST_UNIX` was true.
CMake was emitting a warning:
The dependency target "SanitizerLintCheck" of target "check-ubsan" does not
exist.
llvm-svn: 265613
Duncan P. N. Exon Smith [Wed, 6 Apr 2016 22:37:30 +0000 (22:37 +0000)]
ValueMapper: clang-format ValueMapper.h, NFC
Also remove duplicated identifiers from comments.
llvm-svn: 265611
Wei Mi [Wed, 6 Apr 2016 22:31:17 +0000 (22:31 +0000)]
Fix the compare-clang diff error introduced by r265547.
Use MapVector instead of DenseMap for MergeableSpillsMap so it will be
iterated in determined order.
llvm-svn: 265610
Xinliang David Li [Wed, 6 Apr 2016 22:30:14 +0000 (22:30 +0000)]
sync up with master copy
llvm-svn: 265609
Peter Zotov [Wed, 6 Apr 2016 22:21:29 +0000 (22:21 +0000)]
[llvm-c] Add LLVMGetValueKind.
Patch by Nicole Mazzuca <npmazzuca@gmail.com>.
Differential Revision: http://reviews.llvm.org/D18729
llvm-svn: 265608
Kevin Enderby [Wed, 6 Apr 2016 22:15:23 +0000 (22:15 +0000)]
Needed change to lld for the change to createBinary() now returning Expected<...>
With the llvm change in r265606 this is the matching needed change to the lld
code now that createBinary() is returning Expected<...> .
llvm-svn: 265607
Kevin Enderby [Wed, 6 Apr 2016 22:14:09 +0000 (22:14 +0000)]
Thread Expected<...> up from createMachOObjectFile() to allow llvm-objdump to produce a real error message
Produce the first specific error message for a malformed Mach-O file describing
the problem instead of the generic message for object_error::parse_failed of
"Invalid data was encountered while parsing the file”. Many more good error
messages will follow after this first one.
This is built on Lang Hames’ great work of adding the ’Error' class for
structured error handling and threading Error through MachOObjectFile
construction. And making createMachOObjectFile return Expected<...> .
So to to get the error to the llvm-obdump tool, I changed the stack of
these methods to also return Expected<...> :
object::ObjectFile::createObjectFile()
object::SymbolicFile::createSymbolicFile()
object::createBinary()
Then finally in ParseInputMachO() in MachODump.cpp the error can
be reported and the specific error message can be printed in llvm-objdump
and can be seen in the existing test case for the existing malformed binary
but with the updated error message.
Converting these interfaces to Expected<> from ErrorOr<> does involve
touching a number of places. To contain the changes for now use of
errorToErrorCode() and errorOrToExpected() are used where the callers
are yet to be converted.
Also there some were bugs in the existing code that did not deal with the
old ErrorOr<> return values. So now with Expected<> since they must be
checked and the error handled, I added a TODO and a comment:
“// TODO: Actually report errors helpfully” and a call something like
consumeError(ObjOrErr.takeError()) so the buggy code will not crash
since needed to deal with the Error.
Note there is one fix also needed to lld/COFF/InputFiles.cpp that goes along
with this that I will commit right after this. So expect lld not to built
after this commit and before the next one.
llvm-svn: 265606
Michael Zolotukhin [Wed, 6 Apr 2016 21:47:12 +0000 (21:47 +0000)]
[LoopUnroll] Fix the way we update DT after complete unrolling.
Updating dominators for exit-blocks of the unrolled loops is not enough,
as shown in PR27157. The proper way is to update dominators for all
dominance-children of original loop blocks.
llvm-svn: 265605
Quentin Colombet [Wed, 6 Apr 2016 21:37:22 +0000 (21:37 +0000)]
[RegisterBankInfo] Add methods to get the possible mapping of an instruction on a register bank.
This will be used by the register bank select pass to assign register banks
for generic virtual registers.
This was originally committed as r265573 but broke at least one windows bot.
The problem with the windows bot was that it was using a copy constructor for
the InstructionMappings class and could not synthesize it. Actually, the fact
that this class is not copy constructable is expected and the compiler should
use the move assignment constructor. Marking the problematic assignment
explicitly as using the move constructor has its own problems.
Indeed, with recent clang we get a warning that we may prevent the elision of
the copy by the compiler. A proper fix for both compilers would be to change the
API of getPossibleInstrMapping to take a InstructionMappings as input/output
parameter. This does not feel natural and since GISel is not used on windows
yet, I chose to workaround the problem by not compiling the problematic code on
windows.
llvm-svn: 265604
Adhemerval Zanella [Wed, 6 Apr 2016 21:33:18 +0000 (21:33 +0000)]
[lld] Fix build failure from r265600
llvm-svn: 265603
JF Bastien [Wed, 6 Apr 2016 21:19:33 +0000 (21:19 +0000)]
NFC: make AtomicOrdering an enum class
Summary:
In the context of http://wg21.link/lwg2445 C++ uses the concept of
'stronger' ordering but doesn't define it properly. This should be fixed
in C++17 barring a small question that's still open.
The code currently plays fast and loose with the AtomicOrdering
enum. Using an enum class is one step towards tightening things. I later
also want to tighten related enums, such as clang's
AtomicOrderingKind (which should be shared with LLVM as a 'C++ ABI'
enum).
This change touches a few lines of code which can be improved later, I'd
like to keep it as NFC for now as it's already quite complex. I have
related changes for clang.
As a follow-up I'll add:
bool operator<(AtomicOrdering, AtomicOrdering) = delete;
bool operator>(AtomicOrdering, AtomicOrdering) = delete;
bool operator<=(AtomicOrdering, AtomicOrdering) = delete;
bool operator>=(AtomicOrdering, AtomicOrdering) = delete;
This is separate so that clang and LLVM changes don't need to be in sync.
Reviewers: jyknight, reames
Subscribers: jyknight, llvm-commits
Differential Revision: http://reviews.llvm.org/D18775
llvm-svn: 265602
Sean Silva [Wed, 6 Apr 2016 21:06:52 +0000 (21:06 +0000)]
Revert "Set the default C standard to C99 when targeting the PS4."
This reverts r265359.
It breaks
- llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast
- llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast
Failing Tests (5):
Clang :: FixIt/fixit-errors.c
Clang :: Preprocessor/init.c
Clang :: Sema/attr-deprecated.c
Clang :: Sema/nullability.c
Clang :: SemaObjC/objcbridge-attribute-arc.m
llvm-svn: 265601
Adhemerval Zanella [Wed, 6 Apr 2016 20:59:11 +0000 (20:59 +0000)]
[lld] [ELF] Add ScriptParserBase class
This patch add a base script tokenizer class to decouple parsing from
linker script handling. The idea is to use this base class on dynamic
list parsing (--dynamic-list option). No functionality added.
llvm-svn: 265600
Vassil Vassilev [Wed, 6 Apr 2016 20:58:12 +0000 (20:58 +0000)]
[modules] Add forgotten test case to r265597.
llvm-svn: 265599
Richard Smith [Wed, 6 Apr 2016 20:57:53 +0000 (20:57 +0000)]
Fix order-of-evaluation bug (causing GCC buildbots to fail).
llvm-svn: 265598
Vassil Vassilev [Wed, 6 Apr 2016 20:56:03 +0000 (20:56 +0000)]
[modules] Don't try to add lookup results to non-lookup contexts.
Fixes https://llvm.org/bugs/show_bug.cgi?id=27186
Patch reviewed by Richard Smith.
llvm-svn: 265597
Haicheng Wu [Wed, 6 Apr 2016 20:38:20 +0000 (20:38 +0000)]
[MBP] Remove an unused function parameter
NFC.
llvm-svn: 265596
Sean Silva [Wed, 6 Apr 2016 20:19:31 +0000 (20:19 +0000)]
Use `CMAKE_HOST_UNIX` to check the host.
`UNIX` is for the target.
llvm-svn: 265595
Richard Smith [Wed, 6 Apr 2016 20:12:34 +0000 (20:12 +0000)]
Minor simplifications.
llvm-svn: 265594
Ehsan Amiri [Wed, 6 Apr 2016 20:12:29 +0000 (20:12 +0000)]
[PPC] Use VSX/FP Facility integer load when an integer load's only users are conversion to FP
http://reviews.llvm.org/D18405
When the integer value loaded is never used directly as integer we should use VSX
or Floating Point Facility integer loads and avoid extra direct move
llvm-svn: 265593
Tim Northover [Wed, 6 Apr 2016 19:58:07 +0000 (19:58 +0000)]
Restore slightly less dodgy diagnostic handler for inline asm
Turns out it was there mostly to prevent Clang asking people to report a bug.
This time we report something to Clang's real diagnostics handler so that it
exits with something approximating a real error and tidies up after itself.
llvm-svn: 265592
Sanjay Patel [Wed, 6 Apr 2016 19:58:06 +0000 (19:58 +0000)]
regenerate checks
llvm-svn: 265591
James Y Knight [Wed, 6 Apr 2016 19:52:32 +0000 (19:52 +0000)]
Put quotes around #error string.
GCC reports "missing terminating ' character", even when it's being
skipped by preprocessing.
llvm-svn: 265590
Nicolai Haehnle [Wed, 6 Apr 2016 19:40:20 +0000 (19:40 +0000)]
AMDGPU: Add a shader calling convention
This makes it possible to distinguish between mesa shaders
and other kernels even in the presence of compute shaders.
Patch By: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Differential Revision: http://reviews.llvm.org/D18559
llvm-svn: 265589
Rafael Espindola [Wed, 6 Apr 2016 19:38:26 +0000 (19:38 +0000)]
Make this test a bit stronger.
Show that in addition to handling empty .eh_frame, it is merged with any
regular .eh_frame.
llvm-svn: 265588
Quentin Colombet [Wed, 6 Apr 2016 19:04:58 +0000 (19:04 +0000)]
Revert "[RegisterBankInfo] Add methods to get the possible mapping of an
instruction on a register bank. This will be used by the register bank select
pass to assign register banks for generic virtual registers." and the follow-on
commits while I find out a way to fix the win7 bot:
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/19882
This reverts commit r265578, r265581, r265584, and r265585.
llvm-svn: 265587
Davide Italiano [Wed, 6 Apr 2016 18:46:39 +0000 (18:46 +0000)]
[IRVerifier] Don't crash on invalid DIFile inside DISubprogram.
r265515, this time with the correct fix. file inside DISubprogram is not
mandatory.
llvm-svn: 265586
Quentin Colombet [Wed, 6 Apr 2016 18:43:46 +0000 (18:43 +0000)]
[RegisterBankInfo] Get rid of the assert in the constructor of InstructionMapping.
The default constructor now uses the regular constructor and the assert
is not valid anymore.
llvm-svn: 265585
Quentin Colombet [Wed, 6 Apr 2016 18:37:44 +0000 (18:37 +0000)]
[RegisterBankInfo] Call the other constructor of InstructionMapping from the
default constructor, instead of relying on the default constructor of
unique_ptr.
Second attempt at fixing the windows bot.
llvm-svn: 265584
Evgeniy Stepanov [Wed, 6 Apr 2016 18:32:13 +0000 (18:32 +0000)]
[gold] Save bitcode for module partitions (save-temps + split codegen).
llvm-svn: 265583
Quentin Colombet [Wed, 6 Apr 2016 18:24:34 +0000 (18:24 +0000)]
[RegisterBankInfo] Provide a default constructor for InstructionMapping
helper class.
The default constructor creates invalid (isValid() == false) instances
and may be used to communicate that a mapping was not found.
llvm-svn: 265581
Ed Schouten [Wed, 6 Apr 2016 18:21:07 +0000 (18:21 +0000)]
Sort relocations by name and size.
Approved by: ruiu
Differential Revision: http://reviews.llvm.org/D18835
llvm-svn: 265580
Davide Italiano [Wed, 6 Apr 2016 18:13:44 +0000 (18:13 +0000)]
[IRVerifier] Prefer dyn_cast<> over isa<> + cast<>.
Thanks to Rafael for the suggestion!
llvm-svn: 265579
Quentin Colombet [Wed, 6 Apr 2016 18:04:35 +0000 (18:04 +0000)]
[RegisterBankInfo] Add an helper function to get the size of a register.
The previous method to get the size was too simple and could fail for
physical registers.
llvm-svn: 265578
Duncan P. N. Exon Smith [Wed, 6 Apr 2016 17:56:08 +0000 (17:56 +0000)]
IR: Use DenseSet instead of DenseMap for ConstantUniqueMap; NFC
Use a DenseSet instead of a DenseMap for constants in LLVMContextImpl.
Last time I looked at this was some time before r223588, when
DenseSet<V> had no advantage over DenseMap<V,char>. After r223588,
there's a 50% memory savings.
This is all mechanical. There were little bits of missing API from
DenseSet so I added the trivial implementations:
- iterator::operator++(int)
- template <class LookupKeyT> insert_as(ValueTy, LookupKeyT)
There should be no functionality change, just reduced memory consumption
(this wasn't on a profile or anything; just a cleanup I stumbled on).
llvm-svn: 265577
Duncan P. N. Exon Smith [Wed, 6 Apr 2016 17:56:05 +0000 (17:56 +0000)]
IR: Stop explicitly clearing the MDStringCache
The MDStringCache doesn't need to be explicitly cleared before
destruction. The destructor handles it at least as efficiently.
llvm-svn: 265576
Ed Schouten [Wed, 6 Apr 2016 17:53:31 +0000 (17:53 +0000)]
Make TLS work for PIE executables on aarch64.
Similar to r265462, TLS related relocations aren't marked as relative,
meaning that we end up generating R_AARCH64_RELATIVE relocations for
them. This change adds TLS relocations that I've seen on my system. With
this patch applied CloudABI's unit testing binary now passes on aarch64.
Approved by: ruiu
Differential Revision: http://reviews.llvm.org/D18816
llvm-svn: 265575
Quentin Colombet [Wed, 6 Apr 2016 17:51:41 +0000 (17:51 +0000)]
[RegisterBankInfo] Add a method to get the mapping RegClass -> RegBank.
This should be TableGen'ed at some point.
llvm-svn: 265574