Ben Langmuir [Thu, 13 Aug 2015 17:30:07 +0000 (17:30 +0000)]
Attempt to fix build after r244912
Some compilers were less happy about converting a lambda to a comparator
function for array_pod_sort.
llvm-svn: 244917
James Molloy [Thu, 13 Aug 2015 17:28:26 +0000 (17:28 +0000)]
[ARM] FMINNAN/FMAXNAN of f64 are not legal.
This was my error. We've got f32 marked as legal because they're simulated using a v2f32 instruction, but there's no equivalent for f64.
This will get test coverage imminently when D12015 lands.
llvm-svn: 244916
James Molloy [Thu, 13 Aug 2015 17:28:20 +0000 (17:28 +0000)]
[ARM] Allow vmin/vmax of scalars to be emitted without UseNEONForFP.
This overrides the default to more closely resemble the hand-crafted matching logic in ISelLowering. It makes sense, as there is no VFP equivalent of vmin or vmax, to use them when they're available even if in general VFP ops should be preferred.
This should be NFC.
llvm-svn: 244915
James Molloy [Thu, 13 Aug 2015 17:28:16 +0000 (17:28 +0000)]
[ARM] Rejig vmax tests a bit
They rely on global fast-math options, but soon ISel will rely only on fast-math flags on the instructions themselves. Rip the fast checks out into their own file so we can mark their instructions as fast.
llvm-svn: 244914
James Molloy [Thu, 13 Aug 2015 17:28:10 +0000 (17:28 +0000)]
[AArch64] Small rejig of fmax tests, NFCI.
These tests relied on -enable-no-nans-fp-math, whereas soon they'll take their no-nans hint
from the FCMP instruction itself, so split the no-nans stuff out into its own test.
Also do a slight rejig of instruction order. The old FMIN/MAX backend matching had to deal with looking through casts, which it never did particularly well. Now, instcombine will recognize such patterns and canonicalize the cast outside the select. So modify the test inputs to assume that instcombine has already run.
llvm-svn: 244913
Ben Langmuir [Thu, 13 Aug 2015 17:13:33 +0000 (17:13 +0000)]
[Modules] Add Darwin-specific compatibility module map parsing hacks
This preserves backwards compatibility for two hacks in the Darwin
system module map files:
1. The use of 'requires excluded' to make headers non-modular, which
should really be mapped to 'textual' now that we have this feature.
2. Silently removes a bogus cplusplus requirement from IOKit.avc.
Once we start diagnosing missing requirements and headers on
auto-imports these would have broken compatibility with existing Darwin
SDKs.
llvm-svn: 244912
Rafael Espindola [Thu, 13 Aug 2015 17:04:50 +0000 (17:04 +0000)]
Take name, type and flags in consideration when concatenating sections.
This is mandated by the ELF spec.
llvm-svn: 244911
Reid Kleckner [Thu, 13 Aug 2015 16:40:54 +0000 (16:40 +0000)]
Same fix as r244908 for sanitizer_win.cc instead of asan_win.cc
I forgot to audit lib/sanitizer_common for the same issue. This fixes
writing out coverage files on exit.
llvm-svn: 244910
Reid Kleckner [Thu, 13 Aug 2015 16:37:28 +0000 (16:37 +0000)]
Fix installation of the unhandled exception filter with r244767
Apparently /Zc:inline causes static globals in custom sections to be
discarded if they are unreferenced.
llvm-svn: 244908
Tobias Grosser [Thu, 13 Aug 2015 16:33:32 +0000 (16:33 +0000)]
Manuallt simplify test case
llvm-svn: 244907
Michael Kruse [Thu, 13 Aug 2015 16:28:04 +0000 (16:28 +0000)]
Remove unimplemented private method getTempScop
llvm-svn: 244906
Rafael Espindola [Thu, 13 Aug 2015 15:54:36 +0000 (15:54 +0000)]
Store the offset in the output section, no in the file.
That is the value that is stable as the we layout the output sections.
llvm-svn: 244904
Michael Kruse [Thu, 13 Aug 2015 15:53:53 +0000 (15:53 +0000)]
Add test case for SCEV synthesizing
CodeGenerator currently tries to generate code for a parameter using
values values that are computed later.
llvm-svn: 244903
Martell Malone [Thu, 13 Aug 2015 15:41:04 +0000 (15:41 +0000)]
Driver: Fix include directories when not using libgcc under mingw
Summary:
When we want to use mingw-w64 and clang with compiler-rt we should not
need to have libgcc installed. This fixes finding includes when libgcc
is not installed
Reviewers: yaron.keren
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D11808
llvm-svn: 244902
Erik Eckstein [Thu, 13 Aug 2015 15:36:11 +0000 (15:36 +0000)]
[DeadStoreElimination] remove a redundant store even if the load is in a different block.
DeadStoreElimination does eliminate a store if it stores a value which was loaded from the same memory location.
So far this worked only if the store is in the same block as the load.
Now we can also handle stores which are in a different block than the load.
Example:
define i32 @test(i1, i32*) {
entry:
%l2 = load i32, i32* %1, align 4
br i1 %0, label %bb1, label %bb2
bb1:
br label %bb3
bb2:
; This store is redundant
store i32 %l2, i32* %1, align 4
br label %bb3
bb3:
ret i32 0
}
Differential Revision: http://reviews.llvm.org/D11854
llvm-svn: 244901
Rafael Espindola [Thu, 13 Aug 2015 15:31:17 +0000 (15:31 +0000)]
Don't give an address to sections that are not allocated.
llvm-svn: 244900
Jonathan Peyton [Thu, 13 Aug 2015 15:26:38 +0000 (15:26 +0000)]
Remove unused KMP_SETVERSION macro
This macro and the small amount of code along with it are unused and
can be removed. The macro is never defined in any build script or source file.
llvm-svn: 244899
Rafael Espindola [Thu, 13 Aug 2015 15:23:46 +0000 (15:23 +0000)]
Place SHF_ALLOC sections first in the output.
Having them in the middle of the file complicates the creation of segments.
llvm-svn: 244898
Petar Jovanovic [Thu, 13 Aug 2015 15:12:49 +0000 (15:12 +0000)]
[mips][mcjit] Calculate correct addend for HI16 and PCHI16 reloc
Previously, for O32 ABI we did not calculate correct addend for R_MIPS_HI16
and R_MIPS_PCHI16 relocations. This patch fixes that.
Patch by Vladimir Radosavljevic.
Differential Revision: http://reviews.llvm.org/D11186
llvm-svn: 244897
Rafael Espindola [Thu, 13 Aug 2015 14:48:49 +0000 (14:48 +0000)]
Delete dead code.
llvm-svn: 244896
Rafael Espindola [Thu, 13 Aug 2015 14:45:44 +0000 (14:45 +0000)]
Include non-alloca sections in the link.
llvm-svn: 244895
Joseph Tremoulet [Thu, 13 Aug 2015 14:30:10 +0000 (14:30 +0000)]
[WinEHPrepare] Update demotion logic
Summary:
Update the demotion logic in WinEHPrepare to avoid creating new cleanups by
walking predecessors as necessary to insert stores for EH-pad PHIs.
Also avoid creating stores for EH-pad PHIs that have no uses.
The store/load placement is still pretty naive. Likely future improvements
(at least for optimized compiles) include:
- Share loads for related uses as possible
- Coalesce non-interfering use/def-related PHIs
- Store at definition point rather than each PHI pred for non-interfering
lifetimes.
Reviewers: rnk, majnemer
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11955
llvm-svn: 244894
Ed Maste [Thu, 13 Aug 2015 14:21:03 +0000 (14:21 +0000)]
Enable zero-cost exceptions on non-Apple arm64 platforms
Use the canonical __aarch64__ predefined macro for 64-bit ARM. Apple-
specific cases are left as __arm64__. Also add an #error for unsupported
architectures to catch this sort of case in the future.
Differential Revision: http://reviews.llvm.org/D12005
llvm-svn: 244893
Ed Maste [Thu, 13 Aug 2015 13:45:45 +0000 (13:45 +0000)]
Correct sense of unwind return address register range assertion
I encountered this on FreeBSD/arm64, and then found the same issue was
reported by Daniil Troshkov.
llvm-svn: 244892
Daniel Jasper [Thu, 13 Aug 2015 13:43:51 +0000 (13:43 +0000)]
clang-format: Inside decltype(), there is an expression.
Before:
decltype(a* b) F();
After:
decltype(a * b) F();
llvm-svn: 244891
Daniel Jasper [Thu, 13 Aug 2015 13:37:08 +0000 (13:37 +0000)]
clang-format: Fix incorrect lambda-detection.
Before:
[ a, a ]() -> a<1>{};
After:
[a, a]() -> a<1> {};
llvm-svn: 244890
Ulrich Weigand [Thu, 13 Aug 2015 13:37:06 +0000 (13:37 +0000)]
[SystemZ] Support large LLVM IR struct return values
Recent mesa/llvmpipe crashes on SystemZ due to a failed assertion when
attempting to compile a routine with a return type of
{ <4 x float>, <4 x float>, <4 x float>, <4 x float> }
on a system without vector instruction support.
This is because after legalizing the vector type, we get a return value
consisting of 16 floats, which cannot all be returned in registers.
Usually, what should happen in this case is that the target's CanLowerReturn
routine rejects the return type, in which case SelectionDAG falls back to
implementing a structure return in memory via implicit reference.
However, the SystemZ target never actually implemented any CanLowerReturn
routine, and thus would accept any struct return type.
This patch fixes the crash by implementing CanLowerReturn. As a side effect,
this also handles fp128 return values, fixing a todo that was noted in
SystemZCallingConv.td.
llvm-svn: 244889
Yaron Keren [Thu, 13 Aug 2015 12:42:25 +0000 (12:42 +0000)]
Remove raw_svector_ostream::resync and users. It's no-op after r244870.
llvm-svn: 244888
Charlie Turner [Thu, 13 Aug 2015 12:38:58 +0000 (12:38 +0000)]
[InstCombinePHI] Partial simplification of identity operations.
Consider this code:
BB:
%i = phi i32 [ 0, %if.then ], [ %c, %if.else ]
%add = add nsw i32 %i, %b
...
In this common case the add can be moved to the %if.else basic block, because
adding zero is an identity operation. If we go though %if.then branch it's
always a win, because add is not executed; if not, the number of instructions
stays the same.
This pattern applies also to other instructions like sub, shl, shr, ashr | 0,
mul, sdiv, div | 1.
Patch by Jakub Kuderski!
llvm-svn: 244887
Ravitheja Addepally [Thu, 13 Aug 2015 11:53:23 +0000 (11:53 +0000)]
Removing redundant check from r244875
llvm-svn: 244886
Renato Golin [Thu, 13 Aug 2015 11:25:38 +0000 (11:25 +0000)]
Revert "[LIR] Start leveraging the fundamental guarantees of a loop..."
This reverts commit r244879, as it broke the test-suite on
SingleSource/Regression/C/2004-03-15-IndirectGoto in AArch64.
llvm-svn: 244885
Renato Golin [Thu, 13 Aug 2015 11:25:35 +0000 (11:25 +0000)]
Revert "[LIR] Handle access to AliasAnalysis the same way as the other analysis in LoopIdiomRecognize."
This reverts commit r244880, as it broke the test-suite on
SingleSource/Regression/C/2004-03-15-IndirectGoto in AArch64.
llvm-svn: 244884
Ashutosh Nema [Thu, 13 Aug 2015 11:18:35 +0000 (11:18 +0000)]
Test Commit.
llvm-svn: 244883
John Brawn [Thu, 13 Aug 2015 10:48:22 +0000 (10:48 +0000)]
[ARM] Reorganise and simplify thumb-1 load/store selection
Other than PC-relative loads/store the patterns that match the various
load/store addressing modes have the same complexity, so the order that they
are matched is the order that they appear in the .td file.
Rearrange the instruction definitions in ARMInstrThumb.td, and make use of
AddedComplexity for PC-relative loads, so that the instruction matching order
is the order that results in the simplest selection logic. This also makes
register-offset load/store be selected when it should, as previously it was
only selected for too-large immediate offsets.
Differential Revision: http://reviews.llvm.org/D11800
llvm-svn: 244882
Tamas Berghammer [Thu, 13 Aug 2015 10:41:55 +0000 (10:41 +0000)]
Add missing include to RegisterInfoInterface.h
llvm-svn: 244881
Chandler Carruth [Thu, 13 Aug 2015 10:00:53 +0000 (10:00 +0000)]
[LIR] Handle access to AliasAnalysis the same way as the other analysis
in LoopIdiomRecognize. This is what started me staring at this code. Now
migrating it with the new AA stuff will be trivial.
llvm-svn: 244880
Chandler Carruth [Thu, 13 Aug 2015 09:56:20 +0000 (09:56 +0000)]
[LIR] Start leveraging the fundamental guarantees of a loop in
simplified form to remove redundant checks and simplify the code for
popcount recognition. We don't actually need to handle all of these
cases.
I've left a FIXME for one in particular until I finish inspecting to
make sure we don't actually *rely* on the predicate in any way.
llvm-svn: 244879
Chandler Carruth [Thu, 13 Aug 2015 09:27:01 +0000 (09:27 +0000)]
[LIR] Handle the LoopInfo the same as all the other analyses. No utility
really in breaking pattern just for this analysis.
llvm-svn: 244878
Tamas Berghammer [Thu, 13 Aug 2015 09:19:27 +0000 (09:19 +0000)]
Fix Linux build after r244875
llvm-svn: 244877
Manuel Klimek [Thu, 13 Aug 2015 09:09:28 +0000 (09:09 +0000)]
Fix formatting.
llvm-svn: 244876
Ravitheja Addepally [Thu, 13 Aug 2015 09:05:11 +0000 (09:05 +0000)]
Set orig_eax to -1 for Linux x86 platforms
Summary:
For Linux x86 based environments the orig_eax/orig_rax
register should be set to -1 to prevent the instruction pointer
to be decremented, which was the cause for the SIGILL exception.
Fix for Bug 23659
Reviewers: zturner, ashok.thirumurthi, mikesart, jingham, clayborg
Subscribers: clayborg, labath
Differential Revision: http://reviews.llvm.org/D11411
llvm-svn: 244875
Tobias Grosser [Thu, 13 Aug 2015 08:07:39 +0000 (08:07 +0000)]
Enable code generation of scalar dependences from function arguments
This change extends the BlockGenerator to not only allow Instructions as
base elements of scalar dependences, but any llvm::Value. This allows
us to code-generate scalar dependences which reference function arguments, as
they arise when moddeling read-only scalar dependences.
llvm-svn: 244874
Daniel Jasper [Thu, 13 Aug 2015 07:57:32 +0000 (07:57 +0000)]
Revert "Removed xfail, since test is passing in line with expanded dtor sanitizing functionality"
Still breaking the bot:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/19678/steps/ninja%20check-msan/logs/stdio
llvm-svn: 244873
Simon Pilgrim [Thu, 13 Aug 2015 07:39:03 +0000 (07:39 +0000)]
[InstCombine] SSE/AVX vector shifts demanded shift amount bits
Most SSE/AVX (non-constant) vector shift instructions only use the lower 64-bits of the 128-bit shift amount vector operand, this patch calls SimplifyDemandedVectorElts to optimize for this.
I had to refactor some of my recent InstCombiner work on the vector shifts to avoid quite a bit of duplicate code, it means that SimplifyX86immshift now (re)decodes the type of shift.
Differential Revision: http://reviews.llvm.org/D11938
llvm-svn: 244872
Yaron Keren [Thu, 13 Aug 2015 07:12:03 +0000 (07:12 +0000)]
Remove superfluous private:, TypeCache is private by default.
llvm-svn: 244871
Yaron Keren [Thu, 13 Aug 2015 06:19:52 +0000 (06:19 +0000)]
Modify raw_svector_ostream to use its SmallString without additional buffering.
This is faster and avoids the stream and SmallString state synchronization issue.
resync() is a no-op and may be safely deleted. I'll do so in a follow-up commit.
Reviewed by Rafael Espindola.
llvm-svn: 244870
Yaron Keren [Thu, 13 Aug 2015 06:12:49 +0000 (06:12 +0000)]
Disable failing check in bots from r244867.
llvm-svn: 244869
Chen Li [Thu, 13 Aug 2015 05:24:29 +0000 (05:24 +0000)]
[LoopUnswitch] Check OptimizeForSize before traversing over all basic blocks in current loop
Summary: This patch moves the check of OptimizeForSize before traversing over all basic blocks in current loop. If OptimizeForSize is set to true, no non-trivial unswitch is ever allowed. Therefore, the early exit will help reduce compilation time. This patch should be NFC.
Reviewers: reames, weimingz, broune
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11997
llvm-svn: 244868
Ivan Krasin [Thu, 13 Aug 2015 04:04:37 +0000 (04:04 +0000)]
Add sanitizer blacklists to the rules generated with -M/-MM/-MD/-MMD.
Summary:
Clang sanitizers, such as AddressSanitizer, ThreadSanitizer, MemorySanitizer,
Control Flow Integrity and others, use blacklists to specify which types / functions
should not be instrumented to avoid false positives or suppress known failures.
This change adds the blacklist filenames to the list of dependencies of the rules,
generated with -M/-MM/-MD/-MMD. This lets CMake/Ninja recognize that certain
C/C++/ObjC files need to be recompiled (if a blacklist is updated).
Reviewers: pcc
Subscribers: rsmith, honggyu.kim, pcc, cfe-commits
Differential Revision: http://reviews.llvm.org/D11968
llvm-svn: 244867
Jaydeep Patil [Thu, 13 Aug 2015 03:46:36 +0000 (03:46 +0000)]
[LLDB][MIPS] Use qfThreadID if qC packet is not supported by target
SUMMARY:
The patch uses qfThreadID to get the thread IDs if qC packet is not supported by target.
Reviewers: jingham, clayborg
Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits
Differential Revision: http://reviews.llvm.org/D11519
llvm-svn: 244866
Jaydeep Patil [Thu, 13 Aug 2015 03:46:01 +0000 (03:46 +0000)]
[LLDB][MIPS] Support standard GDB remote stop reply packet for watchpoint
SUMMARY:
The patch supports TAAwatch:addr packet. The patch also sets m_watchpoints_trigger_after_instruction
to eLazyBoolNo when qHostInfo or qWatchpointSupportInfo is not supported by the target.
Reviewers: jingham, clayborg
Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits
Differential Revision: http://reviews.llvm.org/D11747
llvm-svn: 244865
Jaydeep Patil [Thu, 13 Aug 2015 03:44:09 +0000 (03:44 +0000)]
[LLDB][MIPS] Handle false positives for MIPS hardware watchpoints
SUMMARY:
Last 3bits of the watchpoint address are masked by the kernel. For example, n is
at 0x120010d00 and m is 0x120010d04. When a watchpoint is set at m, then watch
exception is generated even when n is read/written. To handle this case, instruction
at PC is emulated to find the base address of the load/store instruction. This address
is then appended to the description of the stop-info packet. Client then reads this
information to check whether the user has set a watchpoint on this address.
Reviewers: jingham, clayborg
Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits
Differential Revision: http://reviews.llvm.org/D11672
llvm-svn: 244864
Bruce Mitchener [Thu, 13 Aug 2015 02:44:40 +0000 (02:44 +0000)]
Add missing newline at EOF.
This fixes a warning on the Mac OS X build.
llvm-svn: 244863
Ahmed Bougacha [Thu, 13 Aug 2015 01:32:30 +0000 (01:32 +0000)]
[CodeGen] Mark the promoted FCOPYSIGN result FP_ROUND as TRUNCating.
Now that we can properly promote mismatched FCOPYSIGNs (r244858), we
can mark the FP_ROUND on the result as truncating, to expose folding.
FCOPYSIGN doesn't change anything but the sign bit, so
(fp_round (fcopysign (fpext a), b))
is equivalent to (modulo the sign bit):
(fp_round (fpext a))
which is a no-op.
llvm-svn: 244862
Ahmed Bougacha [Thu, 13 Aug 2015 01:20:38 +0000 (01:20 +0000)]
[AArch64] Cleanup vector-fcopysign.ll test. NFC.
llvm-svn: 244861
Ahmed Bougacha [Thu, 13 Aug 2015 01:13:56 +0000 (01:13 +0000)]
[AArch64] Also custom-lowering mismatched vector/f16 FCOPYSIGN.
We can lower them using our cool tricks if we fpext/fptrunc the second
input, like we do for f32/f64.
Follow-up to r243924, r243926, and r244858.
llvm-svn: 244860
Ahmed Bougacha [Thu, 13 Aug 2015 01:10:29 +0000 (01:10 +0000)]
[CodeGen] Assert on getNode(FP_EXTEND) with a smaller dst type.
This would have caught the problem in r244858.
llvm-svn: 244859
Ahmed Bougacha [Thu, 13 Aug 2015 01:09:43 +0000 (01:09 +0000)]
[CodeGen] When Promoting, don't extend the 2nd FCOPYSIGN operand.
We don't care about its type, and there's even a combine that'll fold
away the FP_EXTEND if we let it run. However, until it does, we'll have
something broken like:
(f32 (fp_extend (f64 v)))
Scalar f16 follow-up to r243924.
llvm-svn: 244858
Ahmed Bougacha [Thu, 13 Aug 2015 01:08:48 +0000 (01:08 +0000)]
[CodeGen] Simplify getNode(*EXT/TRUNC) type size assert. NFC.
We already check that vectors have the same number of elements, we
don't need to use the scalar types explicitly: comparing the size of
the whole vector is enough.
llvm-svn: 244857
Rafael Espindola [Thu, 13 Aug 2015 01:07:08 +0000 (01:07 +0000)]
Update for llvm api change.
llvm-svn: 244856
Rafael Espindola [Thu, 13 Aug 2015 01:07:06 +0000 (01:07 +0000)]
Update for llvm api change.
llvm-svn: 244855
Rafael Espindola [Thu, 13 Aug 2015 01:07:02 +0000 (01:07 +0000)]
There is only one saver of strings.
llvm-svn: 244854
Chandler Carruth [Thu, 13 Aug 2015 01:03:26 +0000 (01:03 +0000)]
[LIR] Make the LoopIdiomRecognize pass get analyses essentially the same
way as every other pass. This simplifies the code quite a bit and is
also more idiomatic! <ba-dum!>
llvm-svn: 244853
Richard Smith [Thu, 13 Aug 2015 00:45:11 +0000 (00:45 +0000)]
Add SourceManager::dump() to dump the current set of SLocEntries.
llvm-svn: 244852
Chandler Carruth [Thu, 13 Aug 2015 00:44:29 +0000 (00:44 +0000)]
[LIR] Remove the dedicated class for popcount recognition and sink the
code into methods on LoopIdiomRecognize.
This simplifies the code somewhat and also makes it much easier to move
the analyses around. Ultimately, the separate class wasn't providing
significant value over methods -- it contained the precondition basic
block and the current loop. The current loop is already available and
the precondition block wasn't needed everywhere and is easy to pass
around.
In several cases I just moved things to be static functions because they
already accepted most of their inputs as arguments.
This doesn't fix the way we manage analyses yet, that will be the next
patch, but it already makes the code over 50 lines shorter.
No functionality changed.
llvm-svn: 244851
Bruce Mitchener [Thu, 13 Aug 2015 00:32:01 +0000 (00:32 +0000)]
Remove DNBConfig.h
Summary:
This was no longer needed and hasn't been needed since r143244
in 2011. This removes everything associated with generating
or using it.
Reviewers: clayborg, jasonmolenda
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11971
llvm-svn: 244850
Rafael Espindola [Thu, 13 Aug 2015 00:31:46 +0000 (00:31 +0000)]
Update for llvm api change.
llvm-svn: 244849
Rafael Espindola [Thu, 13 Aug 2015 00:31:39 +0000 (00:31 +0000)]
Return ErrorOr from FileOutputBuffer::create. NFC.
llvm-svn: 244848
Dan Gohman [Thu, 13 Aug 2015 00:26:04 +0000 (00:26 +0000)]
[WebAssembly] Declare the llvm.wasm.page.size() intrinsic.
llvm-svn: 244847
Enrico Granata [Thu, 13 Aug 2015 00:24:24 +0000 (00:24 +0000)]
Convert GetNumTemplateArguments() and GetTemplateArgument() to be instance functions on the CompilerType and the TypeSystem
llvm-svn: 244846
Chandler Carruth [Thu, 13 Aug 2015 00:10:03 +0000 (00:10 +0000)]
[LIR] Move all the helpers to be private and re-order the methods in
a way that groups things logically. No functionality changed.
llvm-svn: 244845
Rafael Espindola [Thu, 13 Aug 2015 00:03:47 +0000 (00:03 +0000)]
This test needs lib.exe.
llvm-svn: 244844
David Blaikie [Wed, 12 Aug 2015 23:59:02 +0000 (23:59 +0000)]
Wdeprecated: LambdaScopeInfos need to be copied, so make the ScopeInfo hierarchy safely copyable
Making the base class's copy ctor protected and the derived classes
final to avoid any slicing-prone APIs.
llvm-svn: 244843
Steve King [Wed, 12 Aug 2015 23:56:50 +0000 (23:56 +0000)]
Test Commit - Corrected spelling in README.txt.
llvm-svn: 244842
Chandler Carruth [Wed, 12 Aug 2015 23:55:56 +0000 (23:55 +0000)]
[LIR] Remove the 'LIRUtils' abstraction which was unnecessary and adding
complexity.
There is only one function that was called from multiple locations, and
that was 'getBranch' which has a reasonable one-line spelling already:
dyn_cast<BranchInst>(BB->getTerminator). We could make this shorter, but
it doesn't seem to add much value. Instead, we should avoid calling it
so many times on the same basic blocks, but that will be in a subsequent
patch.
The other functions are only called in one location, so inline them
there, and take advantage of this to use direct early exit and reduce
indentation. This makes it much more clear what is being tested for, and
in fact makes it clear now to me that there are simpler ways to do this
work. However, this patch just does the mechanical inlining. I'll clean
up the functionality of the code to leverage loop simplified form more
effectively in a follow-up.
Despite lots of early line breaks due to early-exit, this is still
shorter than it was before.
llvm-svn: 244841
Reid Kleckner [Wed, 12 Aug 2015 23:55:38 +0000 (23:55 +0000)]
[windows] Fix deadlock on mmap failure due to CHECK recursion
Summary:
Printing a stacktrace acquires a spinlock, and the sanitizer spinlocks
aren't re-entrant. Avoid the problem by reusing the logic we already
have on Posix.
This failure mode is already exercised by the existing mmap_limit_mb.cc
test case. It will be enabled in a forthcoming change, so I didn't add
standalone tests for this change.
Reviewers: samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11999
llvm-svn: 244840
Reid Kleckner [Wed, 12 Aug 2015 23:50:12 +0000 (23:50 +0000)]
Use %env_asan_opts= substitution instead of 'env ASAN_OPTIONS=$ASAN_OPTIONS'
Summary:
The lit internal shell is used by default on Windows, and it does not
support bash variable expansion. Because bash variable expansion
interacts with tokenization, it is prohibitively difficult to make the
existing lit shell do general shell variable expansion.
The most common use of shell variables in the asan tests is to add
options to the default set of options set by lit.cfg. We can avoid the
need for variable expansion with a substitution that expands to 'env
ASAN_OPTIONS=<defaults:>'.
This has the side benefit of shortening the RUN lines, so it seemed
better than implementing limited variable expansion in lit.
Reviewers: samsonov, filcab
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11982
llvm-svn: 244839
David Blaikie [Wed, 12 Aug 2015 23:49:57 +0000 (23:49 +0000)]
Wdeprecated: ApplyDebugLocation is returned by value yet if it is ever copied (rather than RVO'd) that would be broken, make it movable instead
llvm-svn: 244838
Reid Kleckner [Wed, 12 Aug 2015 23:49:52 +0000 (23:49 +0000)]
[windows] Always use the lit shell on Windows, even if bash is present
Summary:
This is consistent with LLVM and Clang. The lit shell isn't a complete
bash implementation, but its behavior is more easily reproducible. This
fixes some ubsan test failures.
One ubsan test requires a shell currently, so I added "REQUIRES: shell",
and the other doesn't work on Windows because it prints a stack trace
and uses a linker that doesn't support DWARF. We can fix it eventually
through other means.
Reviewers: samsonov, pcc
Subscribers: yaron.keren, filcab, llvm-commits
Differential Revision: http://reviews.llvm.org/D11960
llvm-svn: 244837
David Blaikie [Wed, 12 Aug 2015 23:26:58 +0000 (23:26 +0000)]
Wdeprecated: Remove unnecessary user-defined dtor that was getting in the way of the default ops (copy construction, assignment, etc)
llvm-svn: 244836
David Blaikie [Wed, 12 Aug 2015 23:26:12 +0000 (23:26 +0000)]
Simplify PackedVector by removing user-defined special members that aren't any different than the defaults
This causes the other special members (like move and copy construction,
and move assignment) to come through for free. Some code in clang was
depending on the (deprecated, in the original code) copy ctor. Now that
there's no user-defined special members, they're all available without
any deprecation concerns.
llvm-svn: 244835
Rafael Espindola [Wed, 12 Aug 2015 23:25:42 +0000 (23:25 +0000)]
Fix an use of uninitialized.
Should fix some tests on windows.
llvm-svn: 244834
Reid Kleckner [Wed, 12 Aug 2015 23:24:41 +0000 (23:24 +0000)]
Combine helper file into main test file with ifdefs
Keeping tests isolated to a single file is nice, and it was suggested in
post-commit review for r244827.
llvm-svn: 244833
David Blaikie [Wed, 12 Aug 2015 23:18:49 +0000 (23:18 +0000)]
IRBuilder: Use move semantics for the IRBuilderInserter parameter
Just drive by cleanup while fixing -Wdeprecated warnings.
llvm-svn: 244832
David Blaikie [Wed, 12 Aug 2015 23:16:55 +0000 (23:16 +0000)]
Wdeprecated: CGBuilderInserter is copy constructed in some contexts - remove the unnecessarily disabling copy assignment to enable this
The object has very simple state, there seems no reason to disallow all
the usual value semantic operations.
llvm-svn: 244831
David Blaikie [Wed, 12 Aug 2015 23:09:24 +0000 (23:09 +0000)]
-Wdeprecated: Job objects are stored in a vector yet are not really copyable, make them movable instead
llvm-svn: 244829
Chandler Carruth [Wed, 12 Aug 2015 23:06:37 +0000 (23:06 +0000)]
[LIR] Run clang-format over LoopIdiomRecognize in preparation for
a significant code cleanup here.
The handling of analyses in this pass is overly complex and can be
simplified significantly, but the right way to do that is to simplify
all of the code not just the analyses, and that'll require pretty
extensive edits that would be noisy with formatting changes mixed into
them.
llvm-svn: 244828
Reid Kleckner [Wed, 12 Aug 2015 22:58:56 +0000 (22:58 +0000)]
Move tests that use unistd.h and pthread.h to TestCases/Posix
llvm-svn: 244827
David Blaikie [Wed, 12 Aug 2015 22:58:10 +0000 (22:58 +0000)]
-Wdeprecated: SavedInstanceContext is returned by value but isn't really copyable, but it can be made movable
llvm-svn: 244826
Chandler Carruth [Wed, 12 Aug 2015 22:54:47 +0000 (22:54 +0000)]
[PM/AA] Remove the AliasDebugger pass.
This debugger was designed to catch places where the old update API was
failing to be used correctly. As I've removed the update API, it no
longer serves any purpose. We can introduce new debugging aid passes
around any future work w.r.t. updating AAs.
Note that I've updated the documentation here, but really I need to
rewrite the documentation to carefully spell out the ideas around
stateful AA and how things are changing in the AA world. However, I'm
hoping to do that as a follow-up to the refactoring of the AA
infrastructure to work in both old and new pass managers so that I can
write the documentation specific to that world.
Differential Revision: http://reviews.llvm.org/D11984
llvm-svn: 244825
David Majnemer [Wed, 12 Aug 2015 22:30:45 +0000 (22:30 +0000)]
Add myself as the InstCombine owner.
llvm-svn: 244823
Richard Smith [Wed, 12 Aug 2015 22:25:24 +0000 (22:25 +0000)]
[modules] If loading a .pcm file would cause us to run out of source locations, attempt to fail more gracefully. (No test; this requires >= 4GB of preprocessed input...)
llvm-svn: 244822
Philip Reames [Wed, 12 Aug 2015 22:11:45 +0000 (22:11 +0000)]
[RewriteStatepointsForGC] Avoid using unrelocated pointers after safepoints
To be clear: this is an *optimization* not a correctness change.
CodeGenPrep likes to duplicate icmps feeding branch instructions to take advantage of x86's ability to fuze many comparison/branch patterns into a single micro-op and to reduce the need for materializing i1s into general registers. PlaceSafepoints likes to place safepoint polls right at the end of basic blocks (immediately before terminators) when inserting entry and backedge safepoints. These two heuristics interact in a somewhat unfortunate way where the branch terminating the original block will be controlled by a condition driven by unrelocated pointers. This forces the register allocator to keep both the relocated and unrelocated values of the pointers feeding the icmp alive over the safepoint poll.
One simple fix would have been to just adjust PlaceSafepoints to move one back in the basic block, but you can reach similar cases as a result of LICM or other hoisting passes. As a result, doing a post insertion fixup seems to be more robust.
I considered doing this in CodeGenPrep itself, but having to update the live sets of already rewritten safepoints gets complicated fast. In particular, you can't just use def/use information because by moving the icmp, we're extending the live range of it's inputs potentially.
Instead, this patch teaches RewriteStatepointsForGC to make the required adjustments before making the relocations explicit in the IR. This change really highlights the fact that RSForGC is a CodeGenPrep-like pass which is performing target specific lowering. In the long run, we may even want to combine the two though this would require a lot more smarts to be integrated into RSForGC first. We currently rely on being able to run a set of cleanup passes post rewriting because the IR RSForGC generates is pretty damn ugly.
Differential Revision: http://reviews.llvm.org/D11819
llvm-svn: 244821
Naomi Musgrave [Wed, 12 Aug 2015 22:07:24 +0000 (22:07 +0000)]
Revert "Implement poisoning of only class members in dtor, as opposed to also poisoning fields inherited from base classes."
This reverts commit
8dbbf3578a9a5d063232b59e558e5fe46e2cd42c.
Rolled back due to buildbot failures on 'ninja check-clang'.
llvm-svn: 244820
Naomi Musgrave [Wed, 12 Aug 2015 21:37:40 +0000 (21:37 +0000)]
Implement poisoning of only class members in dtor, as opposed to also poisoning fields inherited from base classes.
Verify emitted code for derived class with virtual destructor sanitizes its members only once.
Changed emission order for dtor callback, so only the last dtor for a class emits the sanitizing callback, while ensuring that class members are poisoned before base class destructors are invoked.
Skip poisoning of members, if class has no fields.
Removed patch file containing extraneous changes.
Summary: Poisoning applied to only class members, and before dtors for base class invoked
Reviewers: eugenis, kcc
Differential Revision: http://reviews.llvm.org/D11951
llvm-svn: 244819
Naomi Musgrave [Wed, 12 Aug 2015 21:31:27 +0000 (21:31 +0000)]
Removed xfail, since test is passing in line with expanded dtor sanitizing functionality
Summary: Fixed test in response to buildbot failures from last night.
Reviewers: eugenis, kcc
Differential Revision: http://reviews.llvm.org/D11992
llvm-svn: 244818
Alex Lorenz [Wed, 12 Aug 2015 21:27:16 +0000 (21:27 +0000)]
MIR Parser: Allow the MI IR references to reference global values.
This commit fixes a bug where MI parser couldn't resolve the named IR
references that referenced named global values.
llvm-svn: 244817
Alex Lorenz [Wed, 12 Aug 2015 21:23:17 +0000 (21:23 +0000)]
MIR Serialization: Serialize the fixed stack pseudo source values.
llvm-svn: 244816
Cong Hou [Wed, 12 Aug 2015 21:18:54 +0000 (21:18 +0000)]
NFC. Convert comments in MachineBasicBlock.cpp into new style.
llvm-svn: 244815
Alex Lorenz [Wed, 12 Aug 2015 21:17:02 +0000 (21:17 +0000)]
MIR Parser: Move the parsing of fixed stack object indices into new method. NFC
This commit moves the code that parses the frame indices for the fixed stack
objects from the method 'parseFixedStackObjectOperand' to a new method named
'parseFixedStackFrameIndex', so that it can be reused when parsing fixed stack
pseudo source values.
llvm-svn: 244814