Chandler Carruth [Thu, 24 Jul 2014 22:15:28 +0000 (22:15 +0000)]
[SDAG] Introduce a combined set to the DAG combiner which tracks nodes
which have successfully round-tripped through the combine phase, and use
this to ensure all operands to DAG nodes are visited by the combiner,
even if they are only added during the combine phase.
This is critical to have the combiner reach nodes that are *introduced*
during combining. Previously these would sometimes be visited and
sometimes not be visited based on whether they happened to end up on the
worklist or not. Now we always run them through the combiner.
This fixes quite a few bad codegen test cases lurking in the suite while
also being more principled. Among these, the TLS codegeneration is
particularly exciting for programs that have this in the critical path
like TSan-instrumented binaries (although I think they engineer to use
a different TLS that is faster anyways).
I've tried to check for compile-time regressions here by running llc
over a merged (but not LTO-ed) clang bitcode file and observed at most
a 3% slowdown in llc. Given that this is essentially a worst case (none
of opt or clang are running at this phase) I think this is tolerable.
The actual LTO case should be even less costly, and the cost in normal
compilation should be negligible.
With this combining logic, it is possible to re-legalize as we combine
which is necessary to implement PSHUFB formation on x86 as
a post-legalize DAG combine (my ultimate goal).
Differential Revision: http://reviews.llvm.org/D4638
llvm-svn: 213898
Chandler Carruth [Thu, 24 Jul 2014 22:09:56 +0000 (22:09 +0000)]
[x86] Make vector legalization of extloads work more like the "normal"
vector operation legalization with support for custom target lowering
and fallback to expand when it fails, and use this to implement sext and
anyext load lowering for x86 in a more principled way.
Previously, the x86 backend relied on a target DAG combine to "combine
away" sextload and extload nodes prior to legalization, or would expand
them during legalization with terrible code. This is particularly
problematic because the DAG combine relies on running over non-canonical
DAG nodes at just the right time to match several common and important
patterns. It used a combine rather than lowering because we didn't have
good lowering support, and to expose some tricks being employed to more
combine phases.
With this change it becomes a proper lowering operation, the backend
marks that it can lower these nodes, and I've added support for handling
the canonical forms that don't have direct legal representations such as
sextload of a v4i8 -> v4i64 on AVX1. With this change, our test cases
for this behavior continue to pass even after the DAG combiner beigns
running more systematically over every node.
There is some noise caused by this in the test suite where we actually
use vector extends instead of subregister extraction. This doesn't
really seem like the right thing to do, but is unlikely to be a critical
regression. We do regress in one case where by lowering to the
target-specific patterns early we were able to combine away extraneous
legal math nodes. However, this regression is completely addressed by
switching to a widening based legalization which is what I'm working
toward anyways, so I've just switched the test to that mode.
Differential Revision: http://reviews.llvm.org/D4654
llvm-svn: 213897
Saleem Abdulrasool [Thu, 24 Jul 2014 22:09:06 +0000 (22:09 +0000)]
Target: invert condition for Windows
The Microsoft ABI and MSVCRT are considered the canonical C runtime and ABI.
The long double routines are not part of this environment. However, cygwin and
MinGW both provide supplementary implementations. Change the condition to
reflect this reality.
llvm-svn: 213896
Manman Ren [Thu, 24 Jul 2014 21:13:20 +0000 (21:13 +0000)]
Feedback from Hans on r213815. No functionaility change.
llvm-svn: 213895
Hans Wennborg [Thu, 24 Jul 2014 21:09:45 +0000 (21:09 +0000)]
Windows: Don't wildcard expand /? or -?
Even if there's a file called c:\a, we want /? to be preserved as
an option, not expanded to a filename.
llvm-svn: 213894
Rafael Espindola [Thu, 24 Jul 2014 20:47:42 +0000 (20:47 +0000)]
Use ELF in the clang-interpreter on windows.
We don't support loading COFF files yet.
llvm-svn: 213893
Lang Hames [Thu, 24 Jul 2014 20:40:55 +0000 (20:40 +0000)]
[X86] Optimize stackmap shadows on X86.
This patch minimizes the number of nops that must be emitted on X86 to satisfy
stackmap shadow constraints.
To minimize the number of nops inserted, the X86AsmPrinter now records the
size of the most recent stackmap's shadow in the StackMapShadowTracker class,
and tracks the number of instruction bytes emitted since the that stackmap
instruction was encountered. Padding is emitted (if it is required at all)
immediately before the next stackmap/patchpoint instruction, or at the end of
the basic block.
This optimization should reduce code-size and improve performance for people
using the llvm stackmap intrinsic on X86.
<rdar://problem/
14959522>
llvm-svn: 213892
Reid Kleckner [Thu, 24 Jul 2014 19:53:33 +0000 (19:53 +0000)]
Replace an assertion with a fatal error
Frontends are responsible for putting inalloca on parameters that would
be passed in memory and not registers.
llvm-svn: 213891
Joerg Sonnenberger [Thu, 24 Jul 2014 19:25:16 +0000 (19:25 +0000)]
Use the same .eh_frame encoding for 32bit PPC as on i386.
llvm-svn: 213890
Eric Fiselier [Thu, 24 Jul 2014 19:17:38 +0000 (19:17 +0000)]
[libcxx] expose experimental::erased_type for all standard versions.
Summary: The polymorphic allocator implementation would greatly benefit by defining virtual functions in the dynlib instead of inline. In order to do that some types are going to have to be available outside of c++1y. This is the first step.
Reviewers: mclow.lists, EricWF
Reviewed By: EricWF
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4554
llvm-svn: 213889
Eric Fiselier [Thu, 24 Jul 2014 18:48:34 +0000 (18:48 +0000)]
D4451: Fix copy/move issues casude by __tuple_leafs's converting constructor
llvm-svn: 213888
Eric Fiselier [Thu, 24 Jul 2014 18:41:56 +0000 (18:41 +0000)]
test commit
llvm-svn: 213887
Reid Kleckner [Thu, 24 Jul 2014 18:22:15 +0000 (18:22 +0000)]
Preserve libclang ABI compatibility with the 3.5 release
llvm-svn: 213886
Mark Heffernan [Thu, 24 Jul 2014 18:09:38 +0000 (18:09 +0000)]
Add support for #pragma nounroll.
llvm-svn: 213885
Manman Ren [Thu, 24 Jul 2014 17:57:09 +0000 (17:57 +0000)]
Try to fix the bots again by moving test to X86 directory.
llvm-svn: 213884
Saleem Abdulrasool [Thu, 24 Jul 2014 17:46:36 +0000 (17:46 +0000)]
X86: correct library call setup for Windows itanium
This target is identical to the Windows MSVC (and follows Microsoft ABI for C).
Correct the library call setup for this target. The same set of library calls
are missing on this environment.
llvm-svn: 213883
Matt Arsenault [Thu, 24 Jul 2014 17:41:01 +0000 (17:41 +0000)]
R600: Add FMA instructions for Evergreen
llvm-svn: 213882
Rafael Espindola [Thu, 24 Jul 2014 17:38:18 +0000 (17:38 +0000)]
Attempt at fixing the windows shared build.
llvm-svn: 213881
Manman Ren [Thu, 24 Jul 2014 17:18:33 +0000 (17:18 +0000)]
Try to fix the bots. If this does not work, I am going to move it to X86 directory.
llvm-svn: 213880
Rafael Espindola [Thu, 24 Jul 2014 17:13:09 +0000 (17:13 +0000)]
Use MCJIT.
llvm-svn: 213879
Saleem Abdulrasool [Thu, 24 Jul 2014 17:12:06 +0000 (17:12 +0000)]
X86: silence sign comparison warning
GCC 4.8 detected a signed compare [-Wsign-compare]. Add a cast for the
destination index. Add an assert to catch a potential overflow however unlikely
it may be.
llvm-svn: 213878
Matt Arsenault [Thu, 24 Jul 2014 17:10:35 +0000 (17:10 +0000)]
R600: Add new functions for splitting vector loads and stores.
These will be used in future patches and shouldn't change anything yet.
llvm-svn: 213877
Nico Weber [Thu, 24 Jul 2014 17:08:39 +0000 (17:08 +0000)]
Let the integrated assembler understand .exitm, PR20426.
llvm-svn: 213876
Jim Ingham [Thu, 24 Jul 2014 16:56:19 +0000 (16:56 +0000)]
We were turning off all these tests on OSX and FreeBSD because of a known (and fairly unimportant) bug.
Keep a test for that bug, but let the useful parts of the test run anyway.
llvm-svn: 213875
Nico Weber [Thu, 24 Jul 2014 16:29:04 +0000 (16:29 +0000)]
Remove unused field MacroInstantiation::TheMacro. No behavior change.
llvm-svn: 213874
Nico Weber [Thu, 24 Jul 2014 16:26:06 +0000 (16:26 +0000)]
Let the integrated assembler understand .warning, PR20428.
llvm-svn: 213873
Joerg Sonnenberger [Thu, 24 Jul 2014 16:04:46 +0000 (16:04 +0000)]
Include relative path for header outside the current directory.
llvm-svn: 213872
Rafael Espindola [Thu, 24 Jul 2014 16:02:28 +0000 (16:02 +0000)]
Remove dead code.
Every user has been switched to using EngineBuilder.
llvm-svn: 213871
Johannes Doerfert [Thu, 24 Jul 2014 15:59:06 +0000 (15:59 +0000)]
[Refactor] Remove containsLoop to find innermost loops
Use the fact that if we visit a for node first in pre and next in post order
we know we did not visit any children, thus we found an innermost loop.
+ Test case for an innermost loop with a conditional inside
llvm-svn: 213870
Rafael Espindola [Thu, 24 Jul 2014 15:54:23 +0000 (15:54 +0000)]
Remove the last use of llvm::ExecutionEngine::create.
llvm-svn: 213869
Simon Atanasyan [Thu, 24 Jul 2014 15:42:11 +0000 (15:42 +0000)]
[Mips] Replace assembler code by YAML to make the 'exe-dynsym.test' test
target independent.
llvm-svn: 213868
Tim Northover [Thu, 24 Jul 2014 15:39:55 +0000 (15:39 +0000)]
AArch64: refactor ReconstructShuffle function
Quite a bit of cruft had accumulated as we realised the various different cases
it had to handle and squeezed them in where possible. This refactoring mostly
flattens the logic and special-cases. The result is slightly longer, but I
think clearer.
Should be no functionality change.
llvm-svn: 213867
Duncan P. N. Exon Smith [Thu, 24 Jul 2014 15:16:23 +0000 (15:16 +0000)]
Fix r213824 on windows
llvm-svn: 213866
Aaron Ballman [Thu, 24 Jul 2014 14:51:23 +0000 (14:51 +0000)]
Improving the "integer constant too large" diagnostics based on post-commit feedback from Richard Smith. Amends r213657.
llvm-svn: 213865
Hal Finkel [Thu, 24 Jul 2014 14:25:39 +0000 (14:25 +0000)]
Add scoped-noalias metadata
This commit adds scoped noalias metadata. The primary motivations for this
feature are:
1. To preserve noalias function attribute information when inlining
2. To provide the ability to model block-scope C99 restrict pointers
Neither of these two abilities are added here, only the necessary
infrastructure. In fact, there should be no change to existing functionality,
only the addition of new features. The logic that converts noalias function
parameters into this metadata during inlining will come in a follow-up commit.
What is added here is the ability to generally specify noalias memory-access
sets. Regarding the metadata, alias-analysis scopes are defined similar to TBAA
nodes:
!scope0 = metadata !{ metadata !"scope of foo()" }
!scope1 = metadata !{ metadata !"scope 1", metadata !scope0 }
!scope2 = metadata !{ metadata !"scope 2", metadata !scope0 }
!scope3 = metadata !{ metadata !"scope 2.1", metadata !scope2 }
!scope4 = metadata !{ metadata !"scope 2.2", metadata !scope2 }
Loads and stores can be tagged with an alias-analysis scope, and also, with a
noalias tag for a specific scope:
... = load %ptr1, !alias.scope !{ !scope1 }
... = load %ptr2, !alias.scope !{ !scope1, !scope2 }, !noalias !{ !scope1 }
When evaluating an aliasing query, if one of the instructions is associated
with an alias.scope id that is identical to the noalias scope associated with
the other instruction, or is a descendant (in the scope hierarchy) of the
noalias scope associated with the other instruction, then the two memory
accesses are assumed not to alias.
Note that is the first element of the scope metadata is a string, then it can
be combined accross functions and translation units. The string can be replaced
by a self-reference to create globally unqiue scope identifiers.
[Note: This overview is slightly stylized, since the metadata nodes really need
to just be numbers (!0 instead of !scope0), and the scope lists are also global
unnamed metadata.]
Existing noalias metadata in a callee is "cloned" for use by the inlined code.
This is necessary because the aliasing scopes are unique to each call site
(because of possible control dependencies on the aliasing properties). For
example, consider a function: foo(noalias a, noalias b) { *a = *b; } that gets
inlined into bar() { ... if (...) foo(a1, b1); ... if (...) foo(a2, b2); } --
now just because we know that a1 does not alias with b1 at the first call site,
and a2 does not alias with b2 at the second call site, we cannot let inlining
these functons have the metadata imply that a1 does not alias with b2.
llvm-svn: 213864
Aaron Ballman [Thu, 24 Jul 2014 14:24:59 +0000 (14:24 +0000)]
Fixing an MSVC conversion warning about implicitly converting the shift results to 64-bits. No functional change intended.
llvm-svn: 213863
Aaron Ballman [Thu, 24 Jul 2014 14:13:59 +0000 (14:13 +0000)]
Setting the documentation heading for #pragma unroll, which should not be with the heading for #pragma clang loop.
llvm-svn: 213862
Ed Maste [Thu, 24 Jul 2014 13:28:16 +0000 (13:28 +0000)]
Fix endian test for big-endian hosts
The uint16_t cast truncated the magic value to 0x00000304, making the
first byte 0 (eByteOrderInvalid) on big endian hosts.
Reported by Justin Hibbits.
llvm-svn: 213861
Chandler Carruth [Thu, 24 Jul 2014 12:20:53 +0000 (12:20 +0000)]
[Target] Teach the query interfaces for lowering of extloads and
truncstores to support EVTs and return expand for non-simple ones.
This makes them more consistent with the isLegal... query style methods
and makes using them simpler in many scenarios.
No functionality actually changed.
llvm-svn: 213860
Hal Finkel [Thu, 24 Jul 2014 12:16:19 +0000 (12:16 +0000)]
AA metadata refactoring (introduce AAMDNodes)
In order to enable the preservation of noalias function parameter information
after inlining, and the representation of block-level __restrict__ pointer
information (etc.), additional kinds of aliasing metadata will be introduced.
This metadata needs to be carried around in AliasAnalysis::Location objects
(and MMOs at the SDAG level), and so we need to generalize the current scheme
(which is hard-coded to just one TBAA MDNode*).
This commit introduces only the necessary refactoring to allow for the
introduction of other aliasing metadata types, but does not actually introduce
any (that will come in a follow-up commit). What it does introduce is a new
AAMDNodes structure to hold all of the aliasing metadata nodes associated with
a particular memory-accessing instruction, and uses that structure instead of
the raw MDNode* in AliasAnalysis::Location, etc.
No functionality change intended.
llvm-svn: 213859
Viktor Kutuzov [Thu, 24 Jul 2014 12:05:13 +0000 (12:05 +0000)]
Add FreeBSD support to Asan test cases that use mmap() with MAP_ANON
Differential Revision: http://reviews.llvm.org/D4561
llvm-svn: 213858
NAKAMURA Takumi [Thu, 24 Jul 2014 11:45:27 +0000 (11:45 +0000)]
Prune redundant libdeps.
llvm-svn: 213857
NAKAMURA Takumi [Thu, 24 Jul 2014 11:45:11 +0000 (11:45 +0000)]
Prune dependency to MC from each target disassembler.
llvm-svn: 213856
NAKAMURA Takumi [Thu, 24 Jul 2014 11:44:44 +0000 (11:44 +0000)]
[CMake] tools/lto: Prune redundant libdep(s).
llvm-svn: 213855
NAKAMURA Takumi [Thu, 24 Jul 2014 11:44:33 +0000 (11:44 +0000)]
[CMake] LineEditorTests: Add Support to link_components.
Even if LLVMSupport is added in add_unittests, LLVMSupport may be here as consistency.
llvm-svn: 213854
NAKAMURA Takumi [Thu, 24 Jul 2014 11:44:03 +0000 (11:44 +0000)]
[CMake] LexTests: Prune redundant libdep(s).
llvm-svn: 213853
Tim Northover [Thu, 24 Jul 2014 10:25:34 +0000 (10:25 +0000)]
MachO: use "arm64" as the triple name in modules.
Current versions of ld64 can't cope with "aarch64" being stored. I'm fixing
that, but in the transitionary period we'll need to still emit "arm64".
rdar://problem/
17783765
llvm-svn: 213852
Benjamin Kramer [Thu, 24 Jul 2014 10:23:33 +0000 (10:23 +0000)]
Plug memory leaks.
Most of the changes are mechanic std::unique_ptr insertions. All leaks were
detected by LeakSanitizer.
llvm-svn: 213851
Tilmann Scheller [Thu, 24 Jul 2014 09:55:46 +0000 (09:55 +0000)]
[ARM] Make the assembler reject unpredictable pre/post-indexed ARM STRH instructions.
The ARM ARM prohibits STRH instructions with writeback into the source register. With this commit this constraint is now enforced and we stop assembling STRH instructions with unpredictable behavior.
llvm-svn: 213850
Daniel Sanders [Thu, 24 Jul 2014 09:47:14 +0000 (09:47 +0000)]
[mips] Fix ll and sc instructions
Summary: The ll and sc instructions for r6 and non-r6 are misplaced. This patch fixes that.
Patch by Jyun-Yan You
Differential Revision: http://reviews.llvm.org/D4578
llvm-svn: 213847
Alexey Bataev [Thu, 24 Jul 2014 08:55:34 +0000 (08:55 +0000)]
[OPENMP] Initial parsing and sema analysis for clause 'seq_cst' of 'atomic' directive.
llvm-svn: 213846
Benjamin Kramer [Thu, 24 Jul 2014 08:34:42 +0000 (08:34 +0000)]
[clang-tidy] Fix a heap use-after-free bug detected by asan.
llvm-svn: 213845
Matt Arsenault [Thu, 24 Jul 2014 06:59:24 +0000 (06:59 +0000)]
R600: Match rcp node on pre-SI
llvm-svn: 213844
Matt Arsenault [Thu, 24 Jul 2014 06:59:20 +0000 (06:59 +0000)]
R600: Fix LowerSDIV24
Use ComputeNumSignBits instead of checking for i8 / i16 which only
worked when AMDIL was lying about having legal i8 / i16.
If an integer is known to fit in 24-bits, we can
do division faster with float ops.
llvm-svn: 213843
Alexey Bataev [Thu, 24 Jul 2014 06:46:57 +0000 (06:46 +0000)]
[OPENMP] Initial parsing and sema analysis for clause 'capture' in 'atomic' directive.
llvm-svn: 213842
David Majnemer [Thu, 24 Jul 2014 06:09:19 +0000 (06:09 +0000)]
MS ABI: -fno-rtti-data wasn't data-free enough
While -fno-rtti-data would correctly avoid referencing the RTTI complete
object locator in the VFTable itself, it would emit them anyway.
llvm-svn: 213841
Richard Trieu [Thu, 24 Jul 2014 04:24:50 +0000 (04:24 +0000)]
Add support for nullptr template arguments to template type diffing.
llvm-svn: 213840
Rafael Espindola [Thu, 24 Jul 2014 04:09:04 +0000 (04:09 +0000)]
Remove unused substitution.
llvm-svn: 213839
Richard Smith [Thu, 24 Jul 2014 03:42:38 +0000 (03:42 +0000)]
[modules] Slightly expand module semantics documentation.
llvm-svn: 213838
Richard Smith [Thu, 24 Jul 2014 03:25:00 +0000 (03:25 +0000)]
Simplify MacroInfo lifetime management. We don't need three different functions
to destroy one of these.
llvm-svn: 213837
Duncan P. N. Exon Smith [Thu, 24 Jul 2014 02:56:59 +0000 (02:56 +0000)]
IR: Fix comment from r213824
llvm-svn: 213836
Alexey Bataev [Thu, 24 Jul 2014 02:33:58 +0000 (02:33 +0000)]
[OPENMP] Fixed DSA detecting for function parameters: by default they must be private.
llvm-svn: 213835
Richard Smith [Thu, 24 Jul 2014 02:27:39 +0000 (02:27 +0000)]
Take the canonical type when forming a canonical template argument with
'nullptr' value. Fixes profiling of such template arguments to always give the
same value.
llvm-svn: 213834
NAKAMURA Takumi [Thu, 24 Jul 2014 02:11:24 +0000 (02:11 +0000)]
Remove a stray semicolon. [-Wpedantic]
llvm-svn: 213833
NAKAMURA Takumi [Thu, 24 Jul 2014 02:10:42 +0000 (02:10 +0000)]
Update library dependencies.
llvm-svn: 213832
Matt Arsenault [Thu, 24 Jul 2014 02:10:17 +0000 (02:10 +0000)]
R600: Implement enableClusterLoads()
llvm-svn: 213831
Kevin Qin [Thu, 24 Jul 2014 02:05:42 +0000 (02:05 +0000)]
[AArch64] Fix a bug generating incorrect instruction when building small vector.
This bug is introduced by r211144. The element of operand may be
smaller than the element of result, but previous commit can
only handle the contrary condition. This commit is to handle this
scenario and generate optimized codes like ZIP1.
llvm-svn: 213830
Jason Molenda [Thu, 24 Jul 2014 01:53:11 +0000 (01:53 +0000)]
Add debug asserts / sanity checks to
GDBRemoteRegisterContext::ReadRegisterBytes and
GDBRemoteRegisterContext::WriteRegisterBytes to ensure we don't try
to read/write off the end of the register buffer. This should never
happen but we've had some target confusion in the past where it
did; adding the checks is prudent to avoid crashing here if it happens
again.
<rdar://problem/
16450971>
<rdar://problem/
16458182>
llvm-svn: 213829
Jason Molenda [Thu, 24 Jul 2014 01:36:24 +0000 (01:36 +0000)]
Increase the gdb-remote packet timeout for the first packet we send
to the remote side (QStartNoAckMode) - it may take a little longer
than normal to get a reply.
In debugserver, hardcode the priority for several threads so they
aren't de-prioritized when a user app is using system resources.
Also, set the names of the threads.
<rdar://problem/
17509866>
llvm-svn: 213828
Jiangning Liu [Thu, 24 Jul 2014 01:29:59 +0000 (01:29 +0000)]
[AArch64] Disable some optimization cases for type conversion from sint to fp, because those optimization cases are micro-architecture dependent and only make sense for Cyclone. A new predicate Cyclone is introduced in .td file.
llvm-svn: 213827
Filipe Cabecinhas [Thu, 24 Jul 2014 01:28:21 +0000 (01:28 +0000)]
Fixed PR20411 - bug in getINSERTPS()
When we had a vector_shuffle where we had an input from each vector, we
could miscompile it because we were assuming the input from V2 wouldn't
be moved from where it was on the vector.
Added a test case.
llvm-svn: 213826
Richard Smith [Thu, 24 Jul 2014 01:13:23 +0000 (01:13 +0000)]
Remove unused Prev pointer from MacroInfo chain.
Remove pointless MICache: it only ever contained up to 1 object, and was only
non-empty when recovering from an error. There's no performance or memory win
from maintaining this cache.
llvm-svn: 213825
Duncan P. N. Exon Smith [Thu, 24 Jul 2014 00:53:19 +0000 (00:53 +0000)]
IR: Add Value::sortUseList()
Add `Value::sortUseList()`, templated on the comparison function to use.
The sort is an iterative merge sort that uses a binomial vector of
already-merged lists to limit the size overhead to `O(1)`.
This is part of PR5680.
llvm-svn: 213824
David Majnemer [Thu, 24 Jul 2014 00:26:04 +0000 (00:26 +0000)]
Add a .clang-format file to enhance formatting experience with clang-format
clang-format is a handy tool that formats code very intelligently. I'd
like to use it with LLDB but it requires a .clang-format file to inform
it about LLDB-specific formatting rules.
More information on these rules are here:
http://clang.llvm.org/docs/ClangFormatStyleOptions.html
Differential Revision: http://reviews.llvm.org/D4630
llvm-svn: 213823
David Majnemer [Thu, 24 Jul 2014 00:24:12 +0000 (00:24 +0000)]
ObjectFileMachO: Silence signed/unsigned comparison warning
File::SeekFromStart returns an off_t representing the position of the
file after seeking. This return value is always going to be one of two
values: the input or -1 in the case of failure.
ObjectFileMachO compares an expression of type off_t from the return of
File::SeekFromStart(segment.fileoff) and compares it for equality with
segment.fileoff.
The type of segment_command_64::fileoff is unsigned while off_t is
signed, comparing them emits a diagnostic under GCC.
Instead, we can just compare SeekFromSTart with -1 to see if we
successfully seeked.
Differential Revision: http://reviews.llvm.org/D4634
llvm-svn: 213822
Rui Ueyama [Thu, 24 Jul 2014 00:08:22 +0000 (00:08 +0000)]
Change the signature of insertElementAt and rename addInputElementFront
insertElementAt(x, END) does the identical thing as addInputElement(x),
so the only reasonable use of insertElementAt is to call it with the
other possible argument, BEGIN. That means the second parameter of the
function is just redundant. This patch is to remove the second
parameter and rename the function accordingly.
llvm-svn: 213821
Richard Smith [Wed, 23 Jul 2014 23:50:25 +0000 (23:50 +0000)]
Replace r213816's fix with a different one. It's not meaningful to call
isOnePastTheEnd on an invalid designator, so assert and push the check into the
one caller that wasn't already checking.
llvm-svn: 213820
Reid Kleckner [Wed, 23 Jul 2014 23:49:16 +0000 (23:49 +0000)]
Add a VS "14" msbuild toolset
This allows people to try clang inside MSBuild with the VS "14" CTP
releases.
Fixes PR20341.
Patch by Marcel Raad!
llvm-svn: 213819
Rui Ueyama [Wed, 23 Jul 2014 23:47:28 +0000 (23:47 +0000)]
[PECOFF] Simplify.
insertElementAt(x, END) is the same as addInputElement(x).
llvm-svn: 213818
Reid Kleckner [Wed, 23 Jul 2014 23:29:01 +0000 (23:29 +0000)]
Split -Winvalid-command-line-argument into -Wignored-optimization-argument
Reviewers: rsmith, nlewycky
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4636
llvm-svn: 213817
Reid Kleckner [Wed, 23 Jul 2014 23:24:25 +0000 (23:24 +0000)]
Add a missing Invalid check to SubobjectDesignator::isOnePastEnd()
The class seems to have an invariant that Entries is non-empty if
Invalid is false. It appears this method was previously private, and
all internal uses checked Invalid. Now there is an external caller, so
check Invalid to avoid array OOB underflow.
Fixes PR20420.
llvm-svn: 213816
Manman Ren [Wed, 23 Jul 2014 23:13:23 +0000 (23:13 +0000)]
SimplifyCFG: fix a bug in switch to table conversion
We use gep to access the global array "switch.table", and the table index
should be treated as unsigned. When the highest bit is 1, this commit
zero-extends the index to an integer type with larger size.
For a switch on i2, we used to generate:
%switch.tableidx = sub i2 %0, -2
getelementptr inbounds [4 x i64]* @switch.table, i32 0, i2 %switch.tableidx
It is incorrect when %switch.tableidx is 2 or 3. The fix is to generate
%switch.tableidx = sub i2 %0, -2
%switch.tableidx.zext = zext i2 %switch.tableidx to i3
getelementptr inbounds [4 x i64]* @switch.table, i32 0, i3 %switch.tableidx.zext
rdar://
17735071
llvm-svn: 213815
Rafael Espindola [Wed, 23 Jul 2014 22:54:28 +0000 (22:54 +0000)]
Fix the build when building with only the ARM backend.
llvm-svn: 213814
Rafael Espindola [Wed, 23 Jul 2014 22:43:22 +0000 (22:43 +0000)]
Document what backwards compatibility we provide for bitcode.
llvm-svn: 213813
NAKAMURA Takumi [Wed, 23 Jul 2014 22:38:25 +0000 (22:38 +0000)]
Let llvm/test/CodeGen/X86/avx512*-mask-op.ll(s) aware of Win32 x64 calling convention.
llvm-svn: 213812
Eric Christopher [Wed, 23 Jul 2014 22:34:13 +0000 (22:34 +0000)]
Fix indenting.
llvm-svn: 213811
Chandler Carruth [Wed, 23 Jul 2014 22:29:19 +0000 (22:29 +0000)]
[x86] Rip out some broken test cases for avx512 i1 store support.
It isn't reasonable to test storing things using undef pointers --
storing through those is at best "good luck" and really should be
transformed to "unreachable". Random changes in the combiner can
randomly break these tests for no good reason. I'm following up on the
original commit regarding the right long-term strategy here.
llvm-svn: 213810
Eric Christopher [Wed, 23 Jul 2014 22:27:10 +0000 (22:27 +0000)]
Reorganize and simplify local variables.
llvm-svn: 213809
Rafael Espindola [Wed, 23 Jul 2014 22:26:07 +0000 (22:26 +0000)]
Finish inverting the MC -> Object dependency.
There were still some disassembler bits in lib/MC, but their use of Object
was only visible in the includes they used, not in the symbols.
llvm-svn: 213808
Juergen Ributzka [Wed, 23 Jul 2014 22:23:17 +0000 (22:23 +0000)]
[RuntimeDyld][AArch64] Update relocation tests and also add a simple GOT test.
llvm-svn: 213807
Eric Christopher [Wed, 23 Jul 2014 22:12:03 +0000 (22:12 +0000)]
Remove the query for TargetMachine and TargetInstrInfo since we're
already inside TargetInstrInfo.
llvm-svn: 213806
David Blaikie [Wed, 23 Jul 2014 22:09:29 +0000 (22:09 +0000)]
ArgPromo+DebugInfo: Handle updating debug info over multiple applications of argument promotion.
While the subprogram map cache used by Dead Argument Elimination works
there, I made a mistake when reusing it for Argument Promotion in
r212128 because ArgPromo may transform functions more than once whereas
DAE transforms each function only once, removing all the dead arguments
in one go.
To address this, ensure that the map is updated after each argument
promotion.
In retrospect it might be a little wasteful to create a map of all
subprograms when only handling a single CGSCC, but the alternative is
walking the debug info for each function in the CGSCC that gets updated.
It's not clear to me what the right tradeoff is there, but since the
current tradeoff seems to be working OK (and the code to keep things
updated is very cheap), let's stick with that for now.
llvm-svn: 213805
Rui Ueyama [Wed, 23 Jul 2014 21:41:20 +0000 (21:41 +0000)]
[PECOFF] Add the entry point file at the right place.
The entry point file needs to be processed after all other
object files and before all .lib files. It was processed
after .lib files. That caused an issue that the entry point
function was not resolved from the standard library files.
llvm-svn: 213804
David Blaikie [Wed, 23 Jul 2014 21:30:59 +0000 (21:30 +0000)]
Test debug info in arg promotion with an actual promotion case, rather than a degenerate arg promotion that's actually DAE performed by ArgPromo
Also the debug location I had here was bogus, describing the location of
the call site as in the callee - and unnecessary, so just drop it.
llvm-svn: 213803
Rui Ueyama [Wed, 23 Jul 2014 20:51:04 +0000 (20:51 +0000)]
[PECOFF] Fix entry point address.
Because of a bug, the entry point address in the PE/COFF header
was not correct.
llvm-svn: 213802
Jim Grosbach [Wed, 23 Jul 2014 20:46:32 +0000 (20:46 +0000)]
Use an explicit triple in testcase.
Make the test work better on non-darwin hosts. Hopefully.
llvm-svn: 213801
Jim Grosbach [Wed, 23 Jul 2014 20:41:43 +0000 (20:41 +0000)]
[X86,AArch64] Extend vcmp w/ unary op combine to work w/ more constants.
The transform to constant fold unary operations with an AND across a
vector comparison applies when the constant is not a splat of a scalar
as well.
llvm-svn: 213800
Jim Grosbach [Wed, 23 Jul 2014 20:41:38 +0000 (20:41 +0000)]
X86: restrict combine to when type sizes are safe.
The folding of unary operations through a vector compare and mask operation
is only safe if the unary operation result is of the same size as its input.
For example, it's not safe for [su]itofp from v4i32 to v4f64.
llvm-svn: 213799
Jim Grosbach [Wed, 23 Jul 2014 20:41:31 +0000 (20:41 +0000)]
DAG: fp->int conversion for non-splat constants.
Constant fold the lanes of the input constant build_vector individually
so we correctly handle when the vector elements are not all the same
constant value.
PR20394
llvm-svn: 213798
Johannes Doerfert [Wed, 23 Jul 2014 20:26:25 +0000 (20:26 +0000)]
[Fix] Typo during refactoring
llvm-svn: 213795