Commit Graph

105465 Commits

Author SHA1 Message Date
Daniel Sanders cb0d36e592 Revert: [mips] Correct section alignments and EntrySizes for .bss, .text, .data, .reginfo, .MIPS.options, and .MIPS.abiflags
This commit causes multiple lld tests to fail. Reverting while I investigate the issue.

llvm-svn: 212945
2014-07-14 14:43:45 +00:00
Daniel Sanders 8e254166e1 [mips] Correct section alignments and EntrySizes for .bss, .text, .data, .reginfo, .MIPS.options, and .MIPS.abiflags
Summary:
.bss, .text, and .data are at least 16-byte aligned.
.reginfo is 4-byte aligned and has a 24-byte EntrySize.
.MIPS.abiflags has an 24-byte EntrySize.
.MIPS.options is 8-byte aligned and has 1-byte EntrySize.

Using a 1-byte EntrySize for .MIPS.options seems strange because the
records are neither 1-byte long nor fixed-length but this matches the value
that GAS emits.

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

llvm-svn: 212939
2014-07-14 14:02:14 +00:00
Daniel Sanders 7ddb0ab85f [mips] For the FP64A ABI, odd-numbered double-precision moves must not use mtc1/mfc1.
Summary:
This is because the FP64A the hardware will redirect 32-bit reads/writes
from/to odd-numbered registers to the upper 32-bits of the corresponding
even register. In effect, simulating FR=0 mode when FR=0 mode is not
available.

Unfortunately, we have to make the decision to avoid mfc1/mtc1 before
register allocation so we currently do this for even registers too.

FPXX has a similar requirement on 32-bit architectures that lack
mfhc1/mthc1 so this patch also handles the affected moves from the FPU for
FPXX too. Moves to the FPU were supported by an earlier commit.

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

llvm-svn: 212938
2014-07-14 13:08:14 +00:00
Daniel Sanders 24e08fd5c0 [mips] Use MFHC1 when it is available (MIPS32r2 and later) for both FP32 and FP64 moves
Summary:
This is similar to r210771 which did the same thing for MTHC1.

Also corrected MTHC1_D32 and MTHC1_D64 which used AFGR64 and FGR64 on the
wrong definitions.

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

llvm-svn: 212936
2014-07-14 12:41:31 +00:00
NAKAMURA Takumi 6a931f507a [CMake][Win32.DLL] Let llvm_add_library(SHARED) link dependent libraries as PRIVATE.
For example, c-index-test.exe requires just libclang.dll (its import library).
When libraries in libclang were not PRIVATE but PUBLIC, c-index-test required libraries transitive by libclang.

Note, on mingw with BUILD_SHARED_LIBS, library dependencies would become more strict.
In principle, required libraries should be "required in its source file".

This will help to detect missing dependencies.

llvm-svn: 212934
2014-07-14 12:26:15 +00:00
Tim Northover 3cb24110b1 AArch64: remove unnecessary pseudo-instruction.
Sufficiently twisted use of TableGen lets us write patterns directly for f16
(as an i16 promoted to i32) -> f32 conversion.

llvm-svn: 212933
2014-07-14 11:16:02 +00:00
Daniel Sanders 9ee2aee859 [mips] Correct the AFL_FLAGS1_ODDSPREG flag in .MIPS.abiflags when no '.module oddspreg' is used
Differential Revision: http://reviews.llvm.org/D4486

llvm-svn: 212932
2014-07-14 10:26:15 +00:00
Sasa Stankovic b976fee83c [mips] Expand BuildPairF64 to a spill and reload when the O32 FPXX ABI is
enabled and mthc1 and dmtc1 are not available (e.g. on MIPS32r1)

This prevents the upper 32-bits of a double precision value from being moved to
the FPU with mtc1 to an odd-numbered FPU register. This is necessary to ensure
that the code generated executes correctly regardless of the current FPU mode.

MIPS32r2 and above continues to use mtc1/mthc1, while MIPS-IV and above continue
to use dmtc1.

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

llvm-svn: 212930
2014-07-14 09:40:29 +00:00
Bill Wendling 151b44d653 Support lowering of empty aggregates.
This crash was pretty common while compiling Rust for iOS (armv7). Reason -
SjLj preparation step was lowering aggregate arguments as ExtractValue +
InsertValue. ExtractValue has assertion which checks that there is some data in
value, which is not true in case of empty (no fields) structures. Rust uses
them quite extensively so this patch uses a 'select true, %val, undef'
instruction to lower the argument.

Patch by Valerii Hiora.

llvm-svn: 212922
2014-07-14 06:22:36 +00:00
NAKAMURA Takumi 5c40508457 [CMake] LINK_COMPONENTS: Add also corresponding MCTargetDesc and TargetInfo as well, when target names or "nativecodegen" are specified.
llvm-svn: 212921
2014-07-14 05:07:07 +00:00
NAKAMURA Takumi 23b702c8de [CMake] Update libdeps.
llvm-svn: 212920
2014-07-14 05:01:53 +00:00
NAKAMURA Takumi c3b3897e8a NVPTX/LLVMBuild.txt: Add "Scalar" to required_libraries. It is really referenced.
llvm-svn: 212918
2014-07-14 02:52:19 +00:00
NAKAMURA Takumi a56f860e29 Object/LLVMBuild.txt: Sort required_libraries by alphabetical order.
llvm-svn: 212917
2014-07-14 02:52:08 +00:00
Andrea Di Biagio 67d8b2e2b0 [DAGCombiner] Fix a crash caused by a missing check for legal type when trying to fold shuffles.
Verify that DAGCombiner does not crash when trying to fold a pair of shuffles
according to rule (added at r212539):
  (shuffle (shuffle A, Undef, M0), Undef, M1) -> (shuffle A, Undef, M2)

The DAGCombiner avoids folding shuffles if the resulting shuffle dag node
is not legal for the target. That means, the resulting shuffle must have
legal type and legal mask.

Before, the DAGCombiner only called method
'TargetLowering::isShuffleMaskLegal' to check if it was "safe" to fold according
to the above-mentioned rule. However, this caused a crash in the x86 backend
since method 'isShuffleMaskLegal' always expects to be called on a
legal vector type.

llvm-svn: 212915
2014-07-13 21:02:14 +00:00
Saleem Abdulrasool c7c3cb1f4e MC: make MCWin64EHInstruction a POD-like struct
This is the first of a number of changes designed to generalise
MCWin64EHInstruction to support different target architectures.  An ordered set
(vector) of these instructions is saved per frame to permit the emission of
information for Windows NT style unwinding.  The only bit of information which
is actually target specific here is the Opcode for the unwinding bytecode.  The
remainder of the information is simply generic information that is relevant to
the Windows NT unwinding model.

Remove the accessors for the fields, making them const and public instead.  Sink
the knowledge of the alias'ed name into the single source and sink a single-use
check method into the use.

llvm-svn: 212914
2014-07-13 19:03:45 +00:00
Saleem Abdulrasool 5705cd8cf6 MC: make helper function be more const-correct
Introduce const-ness on parameters, they are used as read-only and should not be
modified.  NFC.

llvm-svn: 212913
2014-07-13 19:03:40 +00:00
Saleem Abdulrasool 3f3cefd392 MC: make DWARF and Windows unwinding handling more similar
Rename member variables and functions for the MCStreamer for DWARF-like
unwinding management.  Rename the Windows ones as well and make the naming and
handling similar across the two.  No functional change intended.

llvm-svn: 212912
2014-07-13 19:03:36 +00:00
Simon Atanasyan 6abd4be930 Add forgotten `break` statement.
llvm-svn: 212910
2014-07-13 16:18:56 +00:00
Simon Atanasyan 1cd169f137 [Mips] Support SHT_MIPS_ABIFLAGS section type flag in the llvm-readobj,
obj2yaml and yaml2obj tools.

llvm-svn: 212908
2014-07-13 15:28:54 +00:00
NAKAMURA Takumi b5bb1e2fc6 [CMake] Enable loadable modules, aka plugins, with BUILD_SHARED_LIBS on cygming.
Loadable modules could be enabled without BUILD_SHARED_LIBS with tweaks in future.

llvm-svn: 212907
2014-07-13 13:47:37 +00:00
NAKAMURA Takumi c4fc6eec53 [CMake] Add LLVM_LINK_COMPONENTS to loadable modules, LLVMHello and BugpointPasses, on Win32.
llvm-svn: 212904
2014-07-13 13:36:48 +00:00
NAKAMURA Takumi 44f64eadd0 [CMake] Introduce moddir for MODULE -- corresponding to LIBRARY_OUTPUT_DIRECTORY.
On Win32.DLL, it points not lib but bin.

LIBRARY_OUTPUT_DIRECTORY affects add_library(MODULE), especially Win32.DLL.

llvm-svn: 212903
2014-07-13 13:33:26 +00:00
NAKAMURA Takumi f0e30f6e5b bugpoint/ToolRunner.cpp: ProcessFailure(): Close ErrorFD immediately, or it couldn't be reopened on Win32.
FIXME: We may have an option in openFileForWrite(), not to use ResultFD but to close it.
llvm-svn: 212902
2014-07-13 13:28:18 +00:00
David Majnemer ebc741168b IR: Allow comdats to be applied to globals with internal linkage
Our verifier check for checking if a global has local linkage was too
strict.  Forbid private linkage but permit local linkage.

Object file formats permit this and forbidding it prevents elimination
of unused, internal, vftables under the MSVC ABI.

llvm-svn: 212900
2014-07-13 04:56:11 +00:00
David Majnemer 299674e94f MC: Let non-temporary COFF aliases be in symtab
MC was aping a binutils bug where aliases would default their linkage to
private instead of internal.

I've sent a patch to the binutils maintainers and they've recently
applied it to the GNU assembler sources.

This fixes PR20152.

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

llvm-svn: 212899
2014-07-13 04:31:19 +00:00
Matt Arsenault c3f6a7e44e Remove unused include
llvm-svn: 212898
2014-07-13 03:08:59 +00:00
Matt Arsenault d32dbb6a10 R600: Use range for and fix missing consts.
llvm-svn: 212897
2014-07-13 03:06:43 +00:00
Matt Arsenault 762af96f46 R600: Make ShaderType private
llvm-svn: 212896
2014-07-13 03:06:39 +00:00
Matt Arsenault 7d5e2cb09f R600: Run more tests with promote alloca disabled.
Re-run tests changed in r211110 to test both paths.
Also fix broken check line.

llvm-svn: 212895
2014-07-13 02:46:17 +00:00
Matt Arsenault d0b6f3e173 R600: Run private-memory test with and without alloca promote
The unpromoted path still needs to be tested since we can't
always promote to using LDS.

llvm-svn: 212894
2014-07-13 02:18:06 +00:00
Matt Arsenault d9a23ab20d R600: Add option to disable promote alloca
This can make writing some tests harder, so add a flag
to disable it.

llvm-svn: 212893
2014-07-13 02:08:26 +00:00
Matt Arsenault 1871d8a080 Try to fix MSVC warning.
llvm-svn: 212889
2014-07-12 23:16:26 +00:00
Matt Arsenault 3c0514f34f Try to fix MSVC build
llvm-svn: 212888
2014-07-12 23:09:02 +00:00
Matt Arsenault 93b775f479 Try to fix MSVC build
llvm-svn: 212886
2014-07-12 22:19:49 +00:00
Matt Arsenault 4181ea36a9 Templatify DominanceFrontier.
Theoretically this should now work for MachineBasicBlocks.

llvm-svn: 212885
2014-07-12 21:59:52 +00:00
Saleem Abdulrasool f74d48a011 AArch64: add support for llvm.aarch64.hint intrinsic
This adds a llvm.aarch64.hint intrinsic to mirror the llvm.arm.hint in order to
support the various hint intrinsic functions in the ACLE.

Add an optional pattern field that permits the subclass to specify the pattern
that matches the selection.  The intrinsic pattern is set as mayLoad, mayStore,
so overload the value for the definition of the hint instruction.

llvm-svn: 212883
2014-07-12 21:20:49 +00:00
Saleem Abdulrasool db514056de MC: remove use of unnecessary variable
Due to the fact that the windows unwinding has the concept of chained frames, we
maintain a current frame info pointer that is adjusted on any push and pop of a
unwinding context.  This just removes an unnecessary variable that was used to
mirror the DWARF unwinding code.

llvm-svn: 212882
2014-07-12 20:49:13 +00:00
Saleem Abdulrasool 4a1a2f7790 MC: rename MCW64UnwindInfo to MCWinFrameInfo
This structure contains information related to the call frame used to generate
unwinding information.  Rename this to reflect the future use to represent the
shared state between various architectures for WinCFI information.

llvm-svn: 212881
2014-07-12 20:49:09 +00:00
Simon Atanasyan 8ebb6aed9b [ELFYAML] Group ELF section type flags to target specific blocks.
Recognize only flags which correspond to the current target.

llvm-svn: 212880
2014-07-12 18:25:08 +00:00
Owen Anderson a8d1c3e74e Fix an issue with the MergeBasicBlockIntoOnlyPred() helper function where it did
not properly handle the case where the predecessor block was the entry block to
the function.  The only in-tree client of this is JumpThreading, which worked
around the issue in its own code.  This patch moves the solution into the helper
so that JumpThreading (and other clients) do not have to replicate the same fix
everywhere.

llvm-svn: 212875
2014-07-12 07:12:47 +00:00
Alexey Samsonov 15c9669615 [ASan] Collect unmangled names of global variables in Clang to print them in error reports.
Currently ASan instrumentation pass creates a string with global name
for each instrumented global (to include global names in the error report). Global
name is already mangled at this point, and we may not be able to demangle it
at runtime (e.g. there is no __cxa_demangle on Android).

Instead, create a string with fully qualified global name in Clang, and pass it
to ASan instrumentation pass in llvm.asan.globals metadata. If there is no metadata
for some global, ASan will use the original algorithm.

This fixes https://code.google.com/p/address-sanitizer/issues/detail?id=264.

llvm-svn: 212872
2014-07-12 00:42:52 +00:00
Matt Arsenault 6026858158 R600: Add missing tests for some intrinsics
llvm-svn: 212870
2014-07-12 00:36:19 +00:00
Duncan P. N. Exon Smith 6075510839 BFI: Add constructor for Weight
llvm-svn: 212868
2014-07-12 00:26:00 +00:00
Duncan P. N. Exon Smith 345c287da9 BFI: Clean up BlockMass
Implementation is small now -- the interesting logic was moved to
`BranchProbability` a while ago.  Move it into `bfi_detail` and get rid
of the related TODOs.

I was originally planning to define it within `BlockFrequencyInfoImpl`
(or `BFIIBase`), but it seems cleaner in a namespace.  Besides,
`isPodLike` needs to be specialized before `BlockMass` can be used in
some of the other data structures, and there isn't a clear way to do
that.

llvm-svn: 212866
2014-07-12 00:21:30 +00:00
Reid Kleckner 9ef63b2836 Option: Propagate flags from groups to options in each group
This should make it easy to set a flag for a whole group of clang driver
options.

llvm-svn: 212865
2014-07-12 00:18:58 +00:00
Lang Hames 5d10284238 [RuntimeDyld] Fix stub size and offset for AArch64 in RuntimeDyldMachO.h.
<rdar://problem/17648000>

llvm-svn: 212864
2014-07-12 00:16:47 +00:00
Reid Kleckner fb9519838a Avoid a warning from MSVC on "*/" in this code by inserting a space
llvm-svn: 212862
2014-07-12 00:06:46 +00:00
Duncan P. N. Exon Smith b5650e5eae BFI: Mark the end of namespaces
llvm-svn: 212861
2014-07-11 23:56:50 +00:00
Lang Hames cb314ceaa9 [RuntimeDyld] Add GOT support for AArch64 to RuntimeDyldMachO.
Test cases to follow once RuntimeDyldChecker supports introspection of stubs.

Fixes <rdar://problem/17648000>

llvm-svn: 212859
2014-07-11 23:52:07 +00:00
Juergen Ributzka d755e9f730 Revert "[FastISel][X86] Implement the FastLowerIntrinsicCall hook."
This reverts commit r212851, because it broke the memset lowering.

llvm-svn: 212855
2014-07-11 23:10:08 +00:00