Nico Weber [Fri, 24 Apr 2015 22:16:53 +0000 (22:16 +0000)]
clang-cl: Don't look up absolute paths in %LIB%.
Before this patch, passing a non-existent absolute path to clang-cl would cause
stat'ing of impossible paths. For example, `clang-cl -c d:\adsfasdf.txt` would
cause a stat of
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIBd:\asdfadsf.cc
llvm-svn: 235787
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 22:07:31 +0000 (22:07 +0000)]
Linker: Copy over function metadata attachments
Update `lib/Linker` to handle `Function` metadata attachments. The
attachments stick with the function body.
llvm-svn: 235786
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 22:04:41 +0000 (22:04 +0000)]
IR: Add assembly/bitcode support for function metadata attachments
Add serialization support for function metadata attachments (added in
r235783). The syntax is:
define @foo() !attach !0 {
Metadata attachments are only allowed on functions with bodies. Since
they come before the `{`, they're not really part of the body; since
they require a body, they're not really part of the header. In
`LLParser` I gave them a separate function called from `ParseDefine()`,
`ParseOptionalFunctionMetadata()`.
In bitcode, I'm using the same `METADATA_ATTACHMENT` record used by
instructions. Instruction metadata attachments are included in a
special "attachment" block at the end of a `Function`. The attachment
records are laid out like this:
InstID (KindID MetadataID)+
Note that these records always have an odd number of fields. The new
code takes advantage of this to recognize function attachments (which
don't need an instruction ID):
(KindID MetadataID)+
This means we can use the same attachment block already used for
instructions.
This is part of PR23340.
llvm-svn: 235785
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 21:53:27 +0000 (21:53 +0000)]
Verifier: Function metadata attachments require a body
Add a verifier check that only functions with bodies have metadata
attachments. This should help catch bugs in frontends and
transformation passes. Part of PR23340.
llvm-svn: 235784
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 21:51:02 +0000 (21:51 +0000)]
IR: Add Function metadata attachments
Add IR support for `Metadata` attachments. Assembly and bitcode support
will follow shortly, but for now we just have unit tests. This is part
of PR23340.
llvm-svn: 235783
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 21:29:36 +0000 (21:29 +0000)]
LLParser: Simplify ParseInstructionMetadata(), NFC
Remove unused `PFS` variable and take the `Instruction` by reference.
(Not really related to PR23340, but might as well clean this up while
I'm here.)
llvm-svn: 235782
Quentin Colombet [Fri, 24 Apr 2015 21:28:00 +0000 (21:28 +0000)]
[DAGCombiner] Fix the type used in canFoldInAddressingMode to account for the
right scaling.
In the function canFoldInAddressingMode, VT is computed as the type of the
destination/source of a LOAD/STORE operations, instead of the memory type of the
operation.
On targets with a scaling factor on the offset of the LOAD/STORE operations, the
function may return false for actually valid cases. This may then prevent the
selection of profitable pre or post indexed load/store operations, and instead
select pre or post indexed load/store for unprofitable cases.
Patch by Francois de Ferriere <francois.de-ferriere@st.com>!
Differential Revision: http://reviews.llvm.org/D9146
llvm-svn: 235780
Timur Iskhodzhanov [Fri, 24 Apr 2015 21:24:51 +0000 (21:24 +0000)]
[ASan/Win] Increase the size of the PC array for coverage on Windows
llvm-svn: 235779
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 21:21:57 +0000 (21:21 +0000)]
LLParser: Split out ParseMetadataAttachment(), NFC
Make the code reusable for `Function` metadata attachments (PR23340).
llvm-svn: 235778
David Blaikie [Fri, 24 Apr 2015 21:16:07 +0000 (21:16 +0000)]
[opaque pointer type] Verifier/AutoUpgrade: Remove a few uses of PointerType::getElementType
llvm-svn: 235777
Rafael Espindola [Fri, 24 Apr 2015 21:10:50 +0000 (21:10 +0000)]
Use MemoryBufferRef instead of MemoryBuffer&. NFC.
This just reduces the noise from another patch.
llvm-svn: 235776
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 21:06:21 +0000 (21:06 +0000)]
AsmWriter: Parameterize the syntactic separator for attachments
Parameterize the separator for attachments, since `Function` metadata
attachments (PR23340) aren't going to use a `,` (comma). No real
functionality change.
llvm-svn: 235775
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 21:03:05 +0000 (21:03 +0000)]
AsmWriter: Only collect attachment names once per module
Collect metadata names once per `AssemblyWriter` instead of every time
we need to print some attachments. Just a drive-by; this caught my eye
while I was refactoring the code in r235772.
llvm-svn: 235774
Kaelyn Takata [Fri, 24 Apr 2015 21:02:18 +0000 (21:02 +0000)]
Remove an unused variable to prevent -Werror build failures.
llvm-svn: 235773
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 20:59:52 +0000 (20:59 +0000)]
AsmWriter: Split out code for printing Metadata attachments, NFC
Refactor the code for printing `Instruction` metadata attachments so it
can be reused for `Function`.
llvm-svn: 235772
Hans Wennborg [Fri, 24 Apr 2015 20:57:56 +0000 (20:57 +0000)]
SimplifyCFG: Correctly handle switch lookup tables which fully cover the input type and use bit tests to check for holes
When using bit tests for hole checks, we call AddPredecessorToBlock to give the
phi node a value from the bit test block. This would break if we've
previously called removePredecessor on the default destination because the
switch is fully covered.
Test case by Mark Lacey.
llvm-svn: 235771
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 20:47:23 +0000 (20:47 +0000)]
IR: Use a bitmask to access GlobalObject subclass data
Make room for more than just `Function::isMaterializable()` in the
`GlobalObject` subclass data bitfield. Since we're treating it like a
bitfield, change `Function::Function()` to zero-out the whole thing.
llvm-svn: 235770
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 20:36:25 +0000 (20:36 +0000)]
IR: Extract set logic from Instruction attachments, NFC
Extract the set logic for metadata attachments from `Instruction` so it
can be reused for `Function` (PR23340).
This data structure makes a `SmallVector<>` look (a little) like a map,
just doing the bare minimum to support the `Instruction` (and soon,
`Function`) metadata API.
llvm-svn: 235769
Reid Kleckner [Fri, 24 Apr 2015 20:25:05 +0000 (20:25 +0000)]
[SEH] Implement GetExceptionCode in __except blocks
This introduces an intrinsic called llvm.eh.exceptioncode. It is lowered
by copying the EAX value live into whatever basic block it is called
from. Obviously, this only works if you insert it late during codegen,
because otherwise mid-level passes might reschedule it.
llvm-svn: 235768
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 20:23:44 +0000 (20:23 +0000)]
IR: Use remove_if for Instruction::dropUnknownMetadata()
Technically the operations are different -- the old logic moved items
from the back into the opened-up slots, instead of the usual
`remove_if()` logic of a slow and a fast iterator -- but unless a
profile tells us otherwise I prefer the simpler logic here. Regardless,
there shouldn't be an observable function change.
llvm-svn: 235767
Saleem Abdulrasool [Fri, 24 Apr 2015 20:21:43 +0000 (20:21 +0000)]
unwind: remove libc++abi tests
These are related to libc++abi's personality routine and not core unwinding.
These have been restored in libc++abi, and are no longer needed here.
llvm-svn: 235766
Saleem Abdulrasool [Fri, 24 Apr 2015 20:20:54 +0000 (20:20 +0000)]
libc++abi: move tests back
These are apparently related to libc++'s unwind personality handler and not
unwind core. Move them back to the correct location.
llvm-svn: 235765
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 20:19:13 +0000 (20:19 +0000)]
IR: Remove MDMapTy and MDPairTy typedefs, NFC
Remove some typedefs in preparation for factoring out attachment logic
from `Instruction`.
llvm-svn: 235764
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 20:16:42 +0000 (20:16 +0000)]
IR: Rename LLVMContextImpl::MetadataStore to InstructionMetadata
Rename `MetadataStore` to the more explicit `InstructionMetadata`. This
will make room for `FunctionMetadata` (start of PR23340).
llvm-svn: 235763
Jan Vesely [Fri, 24 Apr 2015 19:54:17 +0000 (19:54 +0000)]
Fix compilation warnings without cl_khr_fp64
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 235762
Alexey Samsonov [Fri, 24 Apr 2015 19:45:46 +0000 (19:45 +0000)]
[LSan] Add function attribute forgotten in r235728.
llvm-svn: 235761
Saleem Abdulrasool [Fri, 24 Apr 2015 19:40:31 +0000 (19:40 +0000)]
libc++abi: remove the duplicated unwind content
The unwinder has been moved into its own project setup at
http://svn.llvm.org/projects/libunwind/trunk. This simply removes the now
duplicated content. This move was previously discussed on llvmdev at [1].
[1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-January/081507.html
llvm-svn: 235759
Saleem Abdulrasool [Fri, 24 Apr 2015 19:39:17 +0000 (19:39 +0000)]
unwind: move src/Unwind, include/, and test/ unwind content
This moves the majority of the unwind sources into the new project layout for
libunwind. This was previously discussed on llvmdev at [1]. This is a
purely movement related change, with the build infrastructure currently still
residing in the libc++abi repository.
[1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-January/081507.html
llvm-svn: 235758
David Blaikie [Fri, 24 Apr 2015 19:33:25 +0000 (19:33 +0000)]
[opaque pointer type] Update test cases now that the type for an invoke is just a function type, not a pointer-to-function type
llvm-svn: 235756
David Blaikie [Fri, 24 Apr 2015 19:32:54 +0000 (19:32 +0000)]
[opaque pointer type] Add textual IR support for explicit type parameter to the invoke instruction
Same as r235145 for the call instruction - the justification, tradeoffs,
etc are all the same. The conversion script worked the same without any
false negatives (after replacing 'call' with 'invoke').
llvm-svn: 235755
Sundeep Kushwaha [Fri, 24 Apr 2015 19:22:02 +0000 (19:22 +0000)]
[PATCH] [Hexagon] Adding a test case for calling convention.
http://reviews.llvm.org/D9241
llvm-svn: 235754
Lang Hames [Fri, 24 Apr 2015 19:11:51 +0000 (19:11 +0000)]
[AsmPrinter] Make AsmPrinter's OutStreamer member a unique_ptr.
AsmPrinter owns the OutStreamer, so an owning pointer makes sense here. Using a
reference for this is crufty.
llvm-svn: 235752
Rafael Espindola [Fri, 24 Apr 2015 19:08:51 +0000 (19:08 +0000)]
Simplify parseMemberFiles to take a single file.
llvm-svn: 235751
Lang Hames [Fri, 24 Apr 2015 19:08:30 +0000 (19:08 +0000)]
Revert r235749 - Accidentally commited cruft from the wrong path.
llvm-svn: 235750
Lang Hames [Fri, 24 Apr 2015 19:04:55 +0000 (19:04 +0000)]
[CodeGen] Make AsmPrinter's OutStreamer member a unique_ptr.
AsmPrinter owns the OutStreamer, so an owning pointer makes sense here. Using a
reference for this is crufty.
llvm-svn: 235749
Rafael Espindola [Fri, 24 Apr 2015 19:01:30 +0000 (19:01 +0000)]
Simplify now that there is only one file. NFC.
llvm-svn: 235747
Saleem Abdulrasool [Fri, 24 Apr 2015 18:58:18 +0000 (18:58 +0000)]
unwind: stage 2 of creating project structure
llvm-svn: 235746
Rafael Espindola [Fri, 24 Apr 2015 18:51:30 +0000 (18:51 +0000)]
Return ErrorOr<std::unique_ptr<File>>. NFC.
llvm-svn: 235744
Rafael Espindola [Fri, 24 Apr 2015 18:36:57 +0000 (18:36 +0000)]
Remove unused enum value. NFC.
llvm-svn: 235742
Rafael Espindola [Fri, 24 Apr 2015 18:33:50 +0000 (18:33 +0000)]
Return an ErrorOr<std::unique_ptr<File>>. NFC.
llvm-svn: 235741
Davide Italiano [Fri, 24 Apr 2015 18:18:34 +0000 (18:18 +0000)]
[Test] Explictly pass target architecture.
If we're not being explicit, the test fails on windows.
Reported and tested by Aaron Ballman!
llvm-svn: 235739
David Blaikie [Fri, 24 Apr 2015 18:13:27 +0000 (18:13 +0000)]
Revert changes to LTO test case since llvm-lto can't handle textual IR inputs
llvm-svn: 235738
Robert Flack [Fri, 24 Apr 2015 18:09:54 +0000 (18:09 +0000)]
Look for both .debug and dsym debugging symbol information for stripped executable.
Currently Symbols::LocateExecutableSymbolFile on MacOSX only looks for external
dsym debugging information, however if running on a stripped dwarf executable it
should also check for a .debug file as well.
Test Plan:
./dotest.py $DOTEST_OPTS -t -p TestSharedLibStrippedSymbols.py
This test now passes when running a remote Mac -> Linux test, and still passes
running locally on Mac or locally on Linux.
Differential Revision: http://reviews.llvm.org/D9174
llvm-svn: 235737
David Blaikie [Fri, 24 Apr 2015 18:06:09 +0000 (18:06 +0000)]
Skip extra LLVM IR assemble/disassemble steps in some tests
llvm-svn: 235736
David Blaikie [Fri, 24 Apr 2015 18:06:06 +0000 (18:06 +0000)]
[opaque pointer type] bitcode: add explicit callee type to invoke instructions
llvm-svn: 235735
Andrew Kaylor [Fri, 24 Apr 2015 17:39:16 +0000 (17:39 +0000)]
Fix LoopInterchange/reductions.ll test for debug builds
llvm-svn: 235734
Yaron Keren [Fri, 24 Apr 2015 17:14:16 +0000 (17:14 +0000)]
Teach AArch64\lit.local.cfg the new triple names windows-gnu and windows-msvc.
Tests were failing when built with -DLLVM_DEFAULT_TARGET_TRIPLE=i686-pc-windows-gnu.
llvm-svn: 235733
Chris Bieneman [Fri, 24 Apr 2015 17:09:20 +0000 (17:09 +0000)]
[CMake] Fix for PR 23328: LLVM_OPTIMIZED_TABLEGEN broken
In CMake dependencies can be filenames or targets, and targets can't be filenames. The Ninja generator handles filename dependencies because it generates targets for every output file from a command. For example:
add_custom_command(OUTPUT foo.txt COMMAND touch foo.txt)
With the Ninja generator this generates a target foo.txt, but with the Makefile generator it doesn't. This is probably because Ninja explicitly requires these hard dependency ties, and Make just behaves oddly in general.
To fix this we need to make the tablegen actions depend on a target rather than a filename.
llvm-svn: 235732
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 16:56:24 +0000 (16:56 +0000)]
Linker: Update -override testcase to check callers
Check that `@main` is calling `@foo2` (the renamed internal function),
not the `@foo` with external linkage that's been pulled in from the
override file.
llvm-svn: 235730
Hans Wennborg [Fri, 24 Apr 2015 16:53:55 +0000 (16:53 +0000)]
Switch lowering: fix APInt overflow causing infinite loop / OOM
llvm-svn: 235729
Sergey Matveev [Fri, 24 Apr 2015 16:53:15 +0000 (16:53 +0000)]
[lsan] Add an interface function for on-demand leak checking.
Summary:
Add an interface function which can be used to periodically trigger
leak detection in a long-running process.
NB: The meaning of the kIgnored tag has been changed to allow easy clean-up
between subsequent leak checks. Previously, this tag was applied to explicitly
ignored (i.e. with __lsan_disable() or __lsan_ignore_object()) chunks *and* any
chunks only reachable from those. With this change, it's only applied to
explicitly ignored chunks.
Reviewers: samsonov
Reviewed By: samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9159
llvm-svn: 235728
Sergey Matveev [Fri, 24 Apr 2015 16:51:21 +0000 (16:51 +0000)]
Revert r235726 "interface"
Accidentally committed from local branch. :(
llvm-svn: 235727
Sergey Matveev [Fri, 24 Apr 2015 16:49:04 +0000 (16:49 +0000)]
interface
llvm-svn: 235726
Reid Kleckner [Fri, 24 Apr 2015 16:22:19 +0000 (16:22 +0000)]
[WinEH] Split the landingpad BB instead of cloning it
This means we don't have to RAUW the landingpad instruction and
landingpad BB, which is a nice win.
llvm-svn: 235725
Rafael Espindola [Fri, 24 Apr 2015 15:51:45 +0000 (15:51 +0000)]
Delete unnecessary generality in loadFile.
loadFile could load mulitple files just because yaml has a feature for
putting multiple documents in one file.
Designing a linker around what yaml can do seems like a bad idea to
me. This patch changes it to read a single file.
There are further improvements to be done to the api and they
will follow shortly.
llvm-svn: 235724
Diego Novillo [Fri, 24 Apr 2015 15:46:41 +0000 (15:46 +0000)]
Fix typo in comment.
llvm-svn: 235723
Derek Schuff [Fri, 24 Apr 2015 15:45:57 +0000 (15:45 +0000)]
Add COMPILER_RT_ABI attribute to declarations of builtin functions in unittests
Summary:
This makes their local declarations match their definitions for ARM targets,
where they have a different calling convention.
This really only affects functions that use floating point types (since the
runtime functions use soft-float, and some targets may default to hard-float)
but it seemed good to make it uniform and do the int-only ones too.
Differential Revision: http://reviews.llvm.org/D9062
llvm-svn: 235722
Yaron Keren [Fri, 24 Apr 2015 15:39:47 +0000 (15:39 +0000)]
Use the cleaner syntx value initialization to zero initialize POD structs.
Suggestion from David Blaikie!
llvm-svn: 235721
Yaron Keren [Fri, 24 Apr 2015 15:10:15 +0000 (15:10 +0000)]
Silence clang warning: private field 'data_' is not used.
llvm-svn: 235720
Yaron Keren [Fri, 24 Apr 2015 14:26:27 +0000 (14:26 +0000)]
Silence clang warning: missing field 'Dr0' initializer.
llvm-svn: 235719
Vasileios Kalintiris [Fri, 24 Apr 2015 13:48:19 +0000 (13:48 +0000)]
[mips][FastISel] Specify which types we handle for integer extension.
Summary:
Perform integer extension only when the destination type is one of
i8, i16 & i32 and when the source type is i1, i8 or i16. For other
combinations we fall back to SelectionDAG.
This fixes the test MultiSource/Benchmarks/7zip that was failing in our
out-of-tree MIPS buildbots.
Reviewers: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9243
llvm-svn: 235718
Aaron Ballman [Fri, 24 Apr 2015 12:51:45 +0000 (12:51 +0000)]
Removing dead code; NFC. This code was triggering a C4718 warning (recursive call has no side effects, deleting) with MSVC.
llvm-svn: 235717
Tamas Berghammer [Fri, 24 Apr 2015 12:13:44 +0000 (12:13 +0000)]
Fix condition detection in EmulateInstructionARM
The condition detection code is calculating the result of the condition
based on the first 3 bit of the condition and then negate it if the LSB
of the condition is set. It works for the normal conditions but 0b1110
and 0b1111 are special as both of them should evaluate to true
independently the value of CPSR. This CL removes the negating logic from
those cases.
Differential revision: http://reviews.llvm.org/D9219
llvm-svn: 235715
Tamas Berghammer [Fri, 24 Apr 2015 12:13:41 +0000 (12:13 +0000)]
Fix order of b and blx instrction in EmulateInstructionARM
In the previous ordering some "blx <label>" instruction was recognised
as "b #imm24" instructions causing a failure in the instruction
emulator.
Differential revision: http://reviews.llvm.org/D9218
llvm-svn: 235714
Tamas Berghammer [Fri, 24 Apr 2015 12:13:38 +0000 (12:13 +0000)]
Fix write register context for arm "add<c> <Rd>, sp, #imm"
Differential revision: http://reviews.llvm.org/D9213
llvm-svn: 235713
Ilia K [Fri, 24 Apr 2015 11:41:42 +0000 (11:41 +0000)]
Use self.fail() in MiGdbSetShowTestCase.test_lldbmi_gdb_set_target_async_off (MI)
llvm-svn: 235712
Ilia K [Fri, 24 Apr 2015 11:33:36 +0000 (11:33 +0000)]
Fix CMICmnLLDBDebuggerHandleEvents::GetProcessStdout/GetProcessStderr to use stream-record (MI)
llvm-svn: 235711
Filipe Cabecinhas [Fri, 24 Apr 2015 11:30:15 +0000 (11:30 +0000)]
[BitcodeReader] Fix asserts when we read a non-vector type for insert/extract/shuffle
Added some additional checking for vector types + tests.
Bug found with AFL fuzz.
llvm-svn: 235710
Ilia K [Fri, 24 Apr 2015 11:27:36 +0000 (11:27 +0000)]
Fix CMICmnMIOutOfBandRecord to accept stream-records (MI)
Previously the CMICmnMIOutOfBandRecord class worked only with async-records.
llvm-svn: 235709
Simon Atanasyan [Fri, 24 Apr 2015 11:14:24 +0000 (11:14 +0000)]
[Mips] Simplify the code a bit using early return
No functional changes.
llvm-svn: 235708
Daniel Jasper [Fri, 24 Apr 2015 10:08:09 +0000 (10:08 +0000)]
clang-format: Don't wrap after short first segments of builder calls.
Before:
a()
.aaaaa()
.aaaaa()
.aaaaa();
After:
a().aaaaa()
.aaaaa()
.aaaaa();
llvm-svn: 235707
Denis Protivensky [Fri, 24 Apr 2015 09:55:11 +0000 (09:55 +0000)]
[ARM] Update TODO notes
llvm-svn: 235706
Denis Protivensky [Fri, 24 Apr 2015 08:53:02 +0000 (08:53 +0000)]
[ARM] Implement R_ARM_COPY relocation
This adds support of copying objects from shared libraries.
llvm-svn: 235705
Viktor Kutuzov [Fri, 24 Apr 2015 07:54:38 +0000 (07:54 +0000)]
[Msan] XFAIL the ftime.cc test on FreeBSD
Differential Revision: http://reviews.llvm.org/D9222
llvm-svn: 235704
Viktor Kutuzov [Fri, 24 Apr 2015 07:52:47 +0000 (07:52 +0000)]
[Msan] Fix the backtrace.cc tests to build and pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D9221
llvm-svn: 235703
Daniel Jasper [Fri, 24 Apr 2015 07:50:34 +0000 (07:50 +0000)]
clang-format: More selectively detect QT's "signals".
llvm-svn: 235702
Viktor Kutuzov [Fri, 24 Apr 2015 07:48:26 +0000 (07:48 +0000)]
[Sanitizers] Do not call internal_sigdelset() on non-Linux
Differential Revision: http://reviews.llvm.org/D9220
llvm-svn: 235701
Pawel Bylica [Fri, 24 Apr 2015 07:42:35 +0000 (07:42 +0000)]
Correct extractelement constant folding
Summary: Constant folding of extractelement with out-of-bound index produces undef also for indexes bigger than 64bit (instead of crash assert failure as before)
Test Plan: Unit tests included.
Reviewers: majnemer
Reviewed By: majnemer
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9225
llvm-svn: 235700
Pawel Bylica [Fri, 24 Apr 2015 07:38:39 +0000 (07:38 +0000)]
Fix APInt long division algorithm
Summary: This patch fixes step D4 of Knuth's division algorithm implementation. Negative sign of the step result was not always detected due to incorrect "borrow" handling.
Test Plan: Unit test that reveals the bug included.
Reviewers: chandlerc, yaron.keren
Reviewed By: yaron.keren
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9196
llvm-svn: 235699
Craig Topper [Fri, 24 Apr 2015 06:53:50 +0000 (06:53 +0000)]
[TableGen] Clang changes for r235697 to stop leaking Expanders and Operators in SetTheory.
llvm-svn: 235698
Craig Topper [Fri, 24 Apr 2015 06:49:44 +0000 (06:49 +0000)]
[TableGen] Don't leak Expanders and Operators in SetTheory.
llvm-svn: 235697
Craig Topper [Fri, 24 Apr 2015 05:38:48 +0000 (05:38 +0000)]
[TableGen] Fix all remaining memory leaks of Init and RecTy objects.
llvm-svn: 235696
Jingyue Wu [Fri, 24 Apr 2015 04:22:39 +0000 (04:22 +0000)]
Resurrect r235688
We should skip vector types which are not SCEVable.
test/CodeGen/NVPTX/sched2.ll passes
llvm-svn: 235695
Alexey Bataev [Fri, 24 Apr 2015 04:21:15 +0000 (04:21 +0000)]
[OPENMP] Codegen for 'firstprivate' clause in 'single' directive.
Emit the following code for 'single' directive with 'firtstprivate' clause:
if (@__kmpc_single()) {
<init for firstprivates>
@__kmpc_end_single();
}
@__kmpc_cancel_barrier(); // To avoid data race in firstprivate init
Differential Revision: http://reviews.llvm.org/D9223
llvm-svn: 235694
David Majnemer [Fri, 24 Apr 2015 04:14:25 +0000 (04:14 +0000)]
Remove unused variable to silence GCC warning
llvm-svn: 235693
Alexey Bataev [Fri, 24 Apr 2015 04:00:39 +0000 (04:00 +0000)]
[OPENMP] Do not emit implicit barrier for single directive with 'copyprivate' clause(s).
Runtime function for 'copyprivate' directive generates implicit barriers, so no need to emit it.
Differential Revision: http://reviews.llvm.org/D9215
llvm-svn: 235692
Alexey Bataev [Fri, 24 Apr 2015 03:37:03 +0000 (03:37 +0000)]
[OPENMP] Codegen for 'firstprivate' clause in 'sections' directive.
If there are 2 or more sections in a 'section' directive the following code is generated:
<init for firstprivates>
@__kmpc_cancel_barrier();// To avoid data race in firstprivate init
@__kmpc_for_static_init_4();
<BODY for sections directive>
@__kmpc_for_static_fini()
If there is only one section, the following code is generated:
if (@__kmpc_single()) {
<init for firstprivates>
@__kmpc_end_single();
}
@__kmpc_cancel_barrier(); // To avoid data race in firstprivate init
Differential Revision: http://reviews.llvm.org/D9214
llvm-svn: 235691
Jingyue Wu [Fri, 24 Apr 2015 03:26:11 +0000 (03:26 +0000)]
Revert r235688
Seems breaking builds
llvm-svn: 235690
Jingyue Wu [Fri, 24 Apr 2015 02:57:30 +0000 (02:57 +0000)]
[NVPTX] Emits "generic()" depending on the original address space
Summary:
Fixes a bug in the NVPTX codegen. The code used to miss necessary "generic()"
on aggregates of addrspacecasts.
Test Plan: addrspacecast-gvar.ll
Reviewers: eliben, jholewinski
Reviewed By: jholewinski
Subscribers: jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D9130
llvm-svn: 235689
Jingyue Wu [Fri, 24 Apr 2015 02:54:06 +0000 (02:54 +0000)]
[NVPTX] enable NaryReassociate in NVPTX
Summary:
We run NaryReassociate right after SLSR because SLSR enables many
opportunities for NaryReassociate. For example, in nary-slsr.ll
foo((a + b) + c);
foo((a + b * 2) + c);
foo((a + b * 3) + c); // 2 muls and 6 adds
after SLSR:
ab = a + b;
foo(ab + c);
ab2 = ab + b;
foo(ab2 + c);
ab3 = ab2 + b;
foo(ab3 + c); // 6 adds
after NaryReassociate:
abc = (a + b) + c;
foo(abc);
ab2c = abc + b;
foo(ab2c);
ab3c = ab2c + b;
foo(ab3c); // 4 adds
Test Plan: nary-slsr.ll
Reviewers: jholewinski, eliben
Reviewed By: eliben
Subscribers: jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D9066
llvm-svn: 235688
Matt Arsenault [Fri, 24 Apr 2015 01:57:58 +0000 (01:57 +0000)]
R600/SI: Fix verifier error when producing v_madmk_f32
Copy the kill flags when swapping the operands.
llvm-svn: 235687
David Majnemer [Fri, 24 Apr 2015 01:25:08 +0000 (01:25 +0000)]
Replace getPointeeType()->isFunctionType with isMemberDataPointerType
llvm-svn: 235682
David Majnemer [Fri, 24 Apr 2015 01:25:05 +0000 (01:25 +0000)]
[MS ABI] Fix the preferred alignment of member pointers
Member pointers in the MS ABI have different alignment depending on
whether they were created on the stack or live in a record.
llvm-svn: 235681
David Majnemer [Fri, 24 Apr 2015 01:24:59 +0000 (01:24 +0000)]
Cleanup some MS-ABI specific code
No functional change intended.
llvm-svn: 235680
Matthias Braun [Fri, 24 Apr 2015 01:15:27 +0000 (01:15 +0000)]
Improve isTriviallyReMaterializable() documentation.
This should make it clear under which narrow circumstances implicit
physreg uses are okay when rematerializing and prevent people from
accidentally allowing too much when overriding
isReallyTriviallyReMaterializable() even with the weaker assert in the
RegisterCoalescer.
llvm-svn: 235679
Richard Smith [Fri, 24 Apr 2015 00:41:09 +0000 (00:41 +0000)]
[modules] Partial revert of r235669: don't create ModuleMacros for imported local macros.
The surrounding infrastructure isn't quite ready for this yet.
llvm-svn: 235677
Bruce Mitchener [Fri, 24 Apr 2015 00:38:53 +0000 (00:38 +0000)]
Start to share SWIG interface files between languages.
Summary:
Move scripts/Python/interface to scripts/interface so that we
can start making iterative improvements towards sharing the
interface files between multiple languages (each of which would
have their own directory as now).
Test Plan: Build and see.
Reviewers: zturner, emaste, clayborg
Reviewed By: clayborg
Subscribers: mjsabby, lldb-commits
Differential Revision: http://reviews.llvm.org/D9212
llvm-svn: 235676
Matthias Braun [Fri, 24 Apr 2015 00:25:50 +0000 (00:25 +0000)]
R600/RegisterCoalescer: Enable more rematerialization/add missing testcase
This enables the rematerialization of some R600 MOV instructions in the
RegisterCoalescer and adds a testcase for r235668.
llvm-svn: 235675
Michael Zolotukhin [Fri, 24 Apr 2015 00:10:27 +0000 (00:10 +0000)]
Fix a couple of typos in comments.
llvm-svn: 235674
Matthias Braun [Fri, 24 Apr 2015 00:01:37 +0000 (00:01 +0000)]
RegisterCoalescer: implicit phsreg uses are fine when rematerializing
The target hooks should have already checked them. This change is
necessary to enable the remateriailzation on R600.
llvm-svn: 235673