Aaron Ballman [Fri, 16 Aug 2013 14:33:07 +0000 (14:33 +0000)]
Updating function comments; no functional changes intended.
llvm-svn: 188554
Aaron Ballman [Fri, 16 Aug 2013 13:42:41 +0000 (13:42 +0000)]
Passing false instead of 0; no functional change intended.
llvm-svn: 188553
Aaron Ballman [Fri, 16 Aug 2013 13:34:39 +0000 (13:34 +0000)]
Passing false instead of 0; no functional change intended.
llvm-svn: 188552
Benjamin Kramer [Fri, 16 Aug 2013 12:52:08 +0000 (12:52 +0000)]
When initializing the PIC global base register on ARM/ELF add pc to fix the address.
This unbreaks PIC with fast isel on ELF targets (PR16717). The output matches
what GCC and SDag do for PIC but may not cover all of the many flavors of PIC
that exist.
llvm-svn: 188551
Edwin Vane [Fri, 16 Aug 2013 12:18:53 +0000 (12:18 +0000)]
Tweak Replacement comparisons
* Introduce operator< to replace Replacement::Less
* Make operator== and operator< on Replacements non-member functions
* Change order of comparisons in operator< to do string comparisons last
llvm-svn: 188550
Mihai Popa [Fri, 16 Aug 2013 12:03:00 +0000 (12:03 +0000)]
Add support for Thumb2 literal loads with negative zero offset
Thumb2 literal loads use an offset encoding which allows for
negative zero. This fixes parsing and encoding so that #-0
is correctly processed. The parser represents #-0 as INT32_MIN.
llvm-svn: 188549
Mihai Popa [Fri, 16 Aug 2013 11:55:44 +0000 (11:55 +0000)]
Fix Thumb2 aliasing complementary instructions taking modified immediates
There are many Thumb instructions which take 12-bit immediates encoded in a special
8-byte value + 4-byte rotator form. Not all numbers are represented, and it's legal
to transform an assembly instruction to be able to encode the immediate.
For example: AND and BIC are complementary instructions; one can switch the AND
to a BIC as long as the immediate is complemented.
The intent is to switch one instruction into its complementary one when the immediate
cannot be encoded in the form requested in the original assembly and when the
complementary immediate is encodable.
The patch addresses two issues:
1. definition of t2SOImmNot immediate - it has to check that the orignal value is
not encoded naturally
2. t2AND and t2BIC instruction aliases which should use the Thumb2 SOImm operand
rather than the ARM one.
llvm-svn: 188548
Richard Sandiford [Fri, 16 Aug 2013 11:41:43 +0000 (11:41 +0000)]
[SystemZ] Use SRST to implement strlen and strnlen
It would also make sense to use it for memchr; I'm working on that now.
llvm-svn: 188547
Richard Sandiford [Fri, 16 Aug 2013 11:29:37 +0000 (11:29 +0000)]
[SystemZ] Use MVST to implement strcpy and stpcpy
llvm-svn: 188546
Timur Iskhodzhanov [Fri, 16 Aug 2013 11:26:26 +0000 (11:26 +0000)]
[ASan/RTL] Disable colored reporting on Windows
llvm-svn: 188545
Richard Sandiford [Fri, 16 Aug 2013 11:21:54 +0000 (11:21 +0000)]
[SystemZ] Use CLST to implement strcmp
llvm-svn: 188544
Daniel Jasper [Fri, 16 Aug 2013 11:20:30 +0000 (11:20 +0000)]
Split UnwrappedLineFormatter into individual components.
Goals: Structure code better and make components easier to use for
future features (e.g. column layout for long braced initializers).
No functional changes intended.
llvm-svn: 188543
Dmitry Vyukov [Fri, 16 Aug 2013 11:15:14 +0000 (11:15 +0000)]
tsan: better report formatting for Go
Say that gorotuine 1 is main goroutine.
Remove excessive new line.
llvm-svn: 188542
Timur Iskhodzhanov [Fri, 16 Aug 2013 11:04:59 +0000 (11:04 +0000)]
[ASan/RTL] Disable alloc_dealloc_mismatch by default on Windows
llvm-svn: 188541
Richard Sandiford [Fri, 16 Aug 2013 10:55:47 +0000 (10:55 +0000)]
[SystemZ] Fix handling of 64-bit memcmp results
Generalize r188163 to cope with return types other than MVT::i32, just
as the existing visitMemCmpCall code did. I've split this out into a
subroutine so that it can be used for other upcoming patches.
I also noticed that I'd used the wrong API to record the out chain.
It's a load that uses DAG.getRoot() rather than getRoot(), so the out
chain should go on PendingLoads. I don't have a testcase for that because
we don't do any interesting scheduling on z yet.
llvm-svn: 188540
Evgeniy Stepanov [Fri, 16 Aug 2013 10:35:31 +0000 (10:35 +0000)]
Revert r188498.
This change broke release+asserts build with compiler-rt.
llvm-svn: 188539
Richard Sandiford [Fri, 16 Aug 2013 10:22:54 +0000 (10:22 +0000)]
[SystemZ] Fix sign of integer memcmp result
r188163 used CLC to implement memcmp. Code that compares the result
directly against zero can test the CC value produced by CLC, but code
that needs an integer result must use IPM. The sequence I'd used was:
ipm <reg>
sll <reg>, 2
sra <reg>, 30
but I'd forgotten that this inverts the order, so that CC==1 ("less")
becomes an integer greater than zero, and CC==2 ("greater") becomes
an integer less than zero. This sequence should only be used if the
CLC arguments are reversed to compensate. The problem then is that
the branch condition must also be reversed when testing the CLC
result directly.
Rather than do that, I went for a different sequence that works with
the natural CLC order:
ipm <reg>
srl <reg>, 28
rll <reg>, <reg>, 31
One advantage of this is that it doesn't clobber CC. A disadvantage
is that any sign extension to 64 bits must be done separately,
rather than being folded into the shifts.
llvm-svn: 188538
Vladimir Medic [Fri, 16 Aug 2013 10:17:03 +0000 (10:17 +0000)]
This patch implements wait instruction for mips. Examples are added in test files.
llvm-svn: 188537
David Majnemer [Fri, 16 Aug 2013 08:29:13 +0000 (08:29 +0000)]
Parse: Do not 'HandleTopLevelDecl' on templated functions.
Summary:
HandleTopLevelDecl on a templated function leads us to try and mangle
it.
Reviewers: rsmith
Reviewed By: rsmith
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1412
llvm-svn: 188536
Ted Kremenek [Fri, 16 Aug 2013 06:22:23 +0000 (06:22 +0000)]
Fix typo pointed out by Jordan.
llvm-svn: 188535
Craig Topper [Fri, 16 Aug 2013 06:07:34 +0000 (06:07 +0000)]
Don't use v16i32 for load pattern matching. All 512-bit loads are cated to v8i64.
llvm-svn: 188534
Ariel J. Bernal [Fri, 16 Aug 2013 04:40:44 +0000 (04:40 +0000)]
Use -std=c++11 when no compilation database is provided
Allow the migrator to be used without specifing --. If neither -- nor -p is
provided and no compilation database can be detecteded from the first source
file path then -std=c++11 is added as the only compiler argument.
llvm-svn: 188533
Jason Molenda [Fri, 16 Aug 2013 03:20:42 +0000 (03:20 +0000)]
Add a new Section::SetFileAddress method to change a Section's file
address.
When loading a dSYM, and the file addresses of the dSYM Sections are
different than the executable binary Sections' file addresses, the
debug info won't be remapped to the actual load addresses correctly.
This only happens with binaries on the in-memory shared cache binaries
where their File addresses have been set to their actual load address
(outside an offset value) whereas the original executable and dSYM
have 0-based File addresses.
I think this patch will not be activated for other cases -- this is
the only case we know of where the dSYM and the executable's File
addresses differ -- but if this causes other problems we can restrict
it more carefully.
<rdar://problem/
12335086>
llvm-svn: 188532
Hans Wennborg [Fri, 16 Aug 2013 03:15:10 +0000 (03:15 +0000)]
Windows ToolChain: add VS bin dir to PogramPaths
We have a lot of fancy logic to find Visual Studio, which is currently used
to set the system header include paths.
Use the same code to set the ProgramPaths, which is used for finding programs
such as link.exe. Previously, Clang would just search PATH for link.exe,
but now it should find it if it's able to find Visual Studio.
Differential Revision: http://llvm-reviews.chandlerc.com/D1417
llvm-svn: 188531
Aaron Ballman [Fri, 16 Aug 2013 03:06:38 +0000 (03:06 +0000)]
Re-disabling C4291 warnings for MSVC because AttributeList.h requires it. This was accidentally removed in r187279.
llvm-svn: 188530
Matt Arsenault [Fri, 16 Aug 2013 02:59:17 +0000 (02:59 +0000)]
Add missing test for GEP + bitcast transformation
llvm-svn: 188529
Aaron Ballman [Fri, 16 Aug 2013 02:56:43 +0000 (02:56 +0000)]
Calling the base class constructor from the derived class' initializer list. This matches DenseMap's behavior, and silences some warnings.
llvm-svn: 188528
Daniel Dunbar [Fri, 16 Aug 2013 02:54:00 +0000 (02:54 +0000)]
[tests] Add a hack to eliminate some dangling .s files on buildbots.
- Benjamin fixed the emission of this file in r179937, but it still lives on a
few buildbots. We should probably clean up the build dirs once in a while,
eh?
llvm-svn: 188527
Daniel Dunbar [Fri, 16 Aug 2013 02:53:29 +0000 (02:53 +0000)]
[tests] Remove an out-dated failing test.
llvm-svn: 188526
Aaron Ballman [Fri, 16 Aug 2013 01:53:58 +0000 (01:53 +0000)]
Removing a spurious semi-colon; this macro expands into a namespace.
llvm-svn: 188525
Aaron Ballman [Fri, 16 Aug 2013 01:43:31 +0000 (01:43 +0000)]
Fixing a warning about control reaching the end of a non-void function.
llvm-svn: 188524
Tom Stellard [Fri, 16 Aug 2013 01:18:43 +0000 (01:18 +0000)]
Revert "R600/SI: Fix incorrect encoding of DS_WRITE_B32 instructions"
This reverts commit
a6a39ced095c2f453624ce62c4aead25db41a18f.
This is the wrong version of this fix.
llvm-svn: 188523
Tom Stellard [Fri, 16 Aug 2013 01:12:20 +0000 (01:12 +0000)]
R600/SI: Fix incorrect encoding of DS_WRITE_B32 instructions
The SIInsertWaits pass was overwriting the first operand (gds bit) of
DS_WRITE_B32 with the second operand (value to write). This meant that
any time the value to write was stored in an odd number VGPR, the gds
bit would be set causing the instruction to write to GDS instead of LDS.
llvm-svn: 188522
Tom Stellard [Fri, 16 Aug 2013 01:12:16 +0000 (01:12 +0000)]
R600: Add support for global vector loads with element types less than 32-bits
Tested-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 188521
Tom Stellard [Fri, 16 Aug 2013 01:12:11 +0000 (01:12 +0000)]
R600: Add support for global vector stores with elements less than 32-bits
Tested-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 188520
Tom Stellard [Fri, 16 Aug 2013 01:12:06 +0000 (01:12 +0000)]
R600: Add support for i16 and i8 global stores
Tested-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 188519
Tom Stellard [Fri, 16 Aug 2013 01:12:00 +0000 (01:12 +0000)]
R600: Add support for v4i32 stores on Cayman
Tested-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 188518
Tom Stellard [Fri, 16 Aug 2013 01:11:55 +0000 (01:11 +0000)]
R600: Enable folding of inline literals into REQ_SEQUENCE instructions
Tested-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 188517
Tom Stellard [Fri, 16 Aug 2013 01:11:51 +0000 (01:11 +0000)]
R600: Add IsExport bit to TableGen instruction definitions
Tested-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 188516
Tom Stellard [Fri, 16 Aug 2013 01:11:46 +0000 (01:11 +0000)]
R600: Change the RAT instruction assembly names so they match the docs
Tested-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 188515
Jordan Rose [Fri, 16 Aug 2013 01:06:30 +0000 (01:06 +0000)]
[analyzer] Merge TextPathDiagnostics and ClangDiagPathDiagConsumer.
This once again restores notes to following their associated warnings
in -analyzer-output=text mode. (This is still only intended for use as a
debugging aid.)
One twist is that the warning locations in "regular" analysis output modes
(plist, multi-file-plist, html, and plist-html) are reported at a different
location on the command line than in the output file, since the command
line has no path context. This commit makes -analyzer-output=text behave
like a normal output format, which means that the *command line output
will be different* in -analyzer-text mode. Again, since -analyzer-text is
a debugging aid and lo-fi stand-in for a regular output mode, this change
makes sense.
Along the way, remove a few pieces of stale code related to the path
diagnostic consumers.
llvm-svn: 188514
Daniel Dunbar [Fri, 16 Aug 2013 00:37:11 +0000 (00:37 +0000)]
[tests] Cleanup initialization of test suffixes.
- Instead of setting the suffixes in a bunch of places, just set one master
list in the top-level config. We now only modify the suffix list in a few
suites that have one particular unique suffix (.ml, .mc, .yaml, .td, .py).
- Aside from removing the need for a bunch of lit.local.cfg files, this enables
4 tests that were inadvertently being skipped (one in
Transforms/BranchFolding, a .s file each in DebugInfo/AArch64 and
CodeGen/PowerPC, and one in CodeGen/SI which is now failing and has been
XFAILED).
- This commit also fixes a bunch of config files to use config.root instead of
older copy-pasted code.
llvm-svn: 188513
Jim Grosbach [Fri, 16 Aug 2013 00:15:20 +0000 (00:15 +0000)]
InstCombine: Simplify if(x!=0 && x!=-1).
When both constants are positive or both constants are negative,
InstCombine already simplifies comparisons like this, but when
it's exactly zero and -1, the operand sorting ends up reversed
and the pattern fails to match. Handle that special case.
Follow up for rdar://
14689217
llvm-svn: 188512
Eli Friedman [Fri, 16 Aug 2013 00:09:18 +0000 (00:09 +0000)]
Don't allow unary negation on scoped enums.
PR16900.
llvm-svn: 188511
Eli Friedman [Thu, 15 Aug 2013 23:59:20 +0000 (23:59 +0000)]
Fix for dependent contexts in alias templates.
When we are parsing a type for an alias template, we are not entering
the context, so we can't look into dependent classes. Make sure the
parser handles this correctly.
PR16904.
llvm-svn: 188510
Hans Wennborg [Thu, 15 Aug 2013 23:44:31 +0000 (23:44 +0000)]
CMake: polish the Windows packaging rules
This tweaks the CMake rules for building an installation package on Windows:
- Sets license file (otherwise nsis shows an ugly default)
- Adds LLVM logo
- Shows "do you want to add this to the system path" dialog.
Differential Revision: http://llvm-reviews.chandlerc.com/D1414
llvm-svn: 188509
Aaron Ballman [Thu, 15 Aug 2013 23:17:53 +0000 (23:17 +0000)]
Tighten up the yamilizer so it stops eliding empty sequences if the embedded empty sequence is the first key/value in a map which is itself in a sequence.
Patch with help from Nick Kledzik.
llvm-svn: 188508
Matt Arsenault [Thu, 15 Aug 2013 23:11:07 +0000 (23:11 +0000)]
Don't do FoldCmpLoadFromIndexedGlobal for non inbounds GEPs
This path wasn't tested before without a datalayout,
so add some more tests and re-run with and without one.
llvm-svn: 188507
Matt Arsenault [Thu, 15 Aug 2013 23:11:03 +0000 (23:11 +0000)]
Fix spelling
llvm-svn: 188506
DeLesley Hutchins [Thu, 15 Aug 2013 23:06:33 +0000 (23:06 +0000)]
Thread Safety Analysis: fix bug when using TryLock with && and || expressions.
llvm-svn: 188505
Daniel Dunbar [Thu, 15 Aug 2013 22:53:10 +0000 (22:53 +0000)]
Remove empty directory.
llvm-svn: 188504
Daniel Dunbar [Thu, 15 Aug 2013 22:52:27 +0000 (22:52 +0000)]
[tests] Fix refacto in r187764 that effectively disabled SimplifyCFG tests. :(
llvm-svn: 188503
Daniel Dunbar [Thu, 15 Aug 2013 22:52:20 +0000 (22:52 +0000)]
[lit] Remove some done TODOs.
llvm-svn: 188502
David Blaikie [Thu, 15 Aug 2013 22:50:29 +0000 (22:50 +0000)]
DebugInfo: CollectRecordStaticField -> CreateRecordStaticField to return its result.
llvm-svn: 188501
David Blaikie [Thu, 15 Aug 2013 22:42:12 +0000 (22:42 +0000)]
Remove unnecessary explicit cast.
llvm-svn: 188500
Lang Hames [Thu, 15 Aug 2013 22:31:40 +0000 (22:31 +0000)]
Support X86_64_GOTLoad relocations in RuntimeDyldMachO by treating them the
same way as X86_64_GOT relocations. The 'Load' part of GOTLoad is just an
optimization hint for the linker anyway, and can be safely ignored.
This patch also fixes some minor issues with the relocations introduced while
processing an X86_64_GOT[Load]: the addend for the GOT entry should always be
zero, and the addend for the replacement relocation at the original offset
should be the same as the addend of the relocation being replaced.
I haven't come up with a good way of testing this yet, but I'm working on it.
This fixes <rdar://problem/
14651564>.
llvm-svn: 188499
David Blaikie [Thu, 15 Aug 2013 22:30:23 +0000 (22:30 +0000)]
DebugInfo: Split out the implementation of getStaticDataMemberDeclaration for future use
llvm-svn: 188498
Fariborz Jahanian [Thu, 15 Aug 2013 22:26:10 +0000 (22:26 +0000)]
ObjetiveC migrator: fix the test in my last patch
to define real CF_RETURNS_RETAINED/CF_NO_RETURNS_RETAINED
pairs.
llvm-svn: 188497
David Blaikie [Thu, 15 Aug 2013 22:18:13 +0000 (22:18 +0000)]
Fix assert added in r188494
llvm-svn: 188496
Eli Friedman [Thu, 15 Aug 2013 22:02:56 +0000 (22:02 +0000)]
Properly track l-paren of a CXXFucntionalCastExpr.
In addition to storing more useful information in the AST, this
fixes a semantic check in template instantiation which checks whether
the l-paren location is valid.
Fixes PR16903.
llvm-svn: 188495
David Blaikie [Thu, 15 Aug 2013 21:55:56 +0000 (21:55 +0000)]
DebugInfo: Remove unused conditional
llvm-svn: 188494
Fariborz Jahanian [Thu, 15 Aug 2013 21:44:38 +0000 (21:44 +0000)]
ObjectiveC migrator. Start annotating CF functions
with CF_RETURNS_RETAINED/CF_RETURNS_NOT_RETAINED as
appropriate.
llvm-svn: 188493
David Blaikie [Thu, 15 Aug 2013 21:42:43 +0000 (21:42 +0000)]
DebugInfo: Make CGDebugInfo::getStaticDataMemberDeclaration's argument type match the semantics
Rather than having a cast immediately inside the function, push that
type requirement out to the callers.
llvm-svn: 188492
David Blaikie [Thu, 15 Aug 2013 21:21:19 +0000 (21:21 +0000)]
DebugInfo: Add a FIXME, remove a FIXME.
(the removed FIXME no longer applies since we made this debug info
optimization not apply to C)
llvm-svn: 188491
Peter Collingbourne [Thu, 15 Aug 2013 21:18:53 +0000 (21:18 +0000)]
[dfsan] Initial set of custom functions and interceptors for libc.
Differential Revision: http://llvm-reviews.chandlerc.com/D1397
llvm-svn: 188490
Yunzhong Gao [Thu, 15 Aug 2013 20:58:59 +0000 (20:58 +0000)]
Fixing a corner-case bug in strchr and strrchr lib call optimizations where
the input character is not converted to char before comparing with zero.
The patch was discussed in this thread:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-
20130812/184069.html
llvm-svn: 188489
Renato Golin [Thu, 15 Aug 2013 20:54:45 +0000 (20:54 +0000)]
make arm-use-movt available for all ARM
This updates clang according to a pending patch for llvm to
rename of the -arm-darwin-use-movt to arm-use-movt to make
it available for all of ARM.
note: please apply this close to the llvm change.
Patch by Jeroen Hofstee.
llvm-svn: 188488
Renato Golin [Thu, 15 Aug 2013 20:54:38 +0000 (20:54 +0000)]
make arm-use-movt available for all ARM
Before this patch this flag is IOS specific, but is also
useful for bare project like bootloaders / kernels etc,
since movw / movt prevents simple relocation. Therefore
make this flag more commonly available.
note: this patch depends on a similiar rename in clang
Patch by Jeroen Hofstee.
llvm-svn: 188487
David Blaikie [Thu, 15 Aug 2013 20:49:17 +0000 (20:49 +0000)]
DebugInfo: Unify & optimize the lazy addition of record types
Rather than going through the whole getOrCreateType machinery to
manifest a type, cut straight to the implementation because we know we
have to do work.
While the previous implementation was sufficient for the two cases
(completeness and required completeness) we have already (the general
machinery could inspect the type for those attributes & go down the full
definition path), a pending change (to emit info for types when we emit
their vtables) won't have that luxury & we'll need to force the creation
rather than relying on the general purpose routine.
llvm-svn: 188486
Renato Golin [Thu, 15 Aug 2013 20:45:13 +0000 (20:45 +0000)]
make arm-reserve-r9 available for all ARM
r9 is defined as a platform-specific register in the ARM EABI.
It can be reserved for a special purpose or be used as a general
purpose register. Add support for reserving r9 for all ARM, while
leaving the IOS usage unchanged.
Patch by Jeroen Hofstee.
llvm-svn: 188485
Bill Wendling [Thu, 15 Aug 2013 20:25:44 +0000 (20:25 +0000)]
Make a few more things const.
llvm-svn: 188484
Bill Wendling [Thu, 15 Aug 2013 20:21:49 +0000 (20:21 +0000)]
Use a reference instead of making an unnecessary copy. Also use 'const'.
llvm-svn: 188483
David Blaikie [Thu, 15 Aug 2013 20:17:25 +0000 (20:17 +0000)]
DebugInfo: Revert change to the return type of createRecordFwdDecl
It still does only return DICompositeType, but I've no need to make that
change right now.
llvm-svn: 188482
David Majnemer [Thu, 15 Aug 2013 19:59:14 +0000 (19:59 +0000)]
CodeGen: __uuidof should work even with an incomplete _GUID type
Summary:
We would crash in CodeGen::CodeGenModule::EmitUuidofInitializer
because our attempt to enter CodeGen::CodeGenModule::EmitConstantValue
will be foiled: the type of the constant value is incomplete.
Instead, create an unnamed type with the proper layout on all platforms.
Punt the problem of wrongly defined struct _GUID types to the user.
(It's impossible because the TU may never get to see the type and thus
we can't verify that it is suitable.)
This fixes PR16856.
Reviewers: rsmith, rnk, thakis
Reviewed By: rnk
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1375
llvm-svn: 188481
Fariborz Jahanian [Thu, 15 Aug 2013 19:27:42 +0000 (19:27 +0000)]
Add another test to my last patch (NS_OPTION vs. NS_ENUM)
ObjectiveC migration.
llvm-svn: 188480
Michael Gottesman [Thu, 15 Aug 2013 19:22:36 +0000 (19:22 +0000)]
[autotools->cmake] Added variable CLANG_VENDOR_UTI.
llvm-svn: 188479
Michael Gottesman [Thu, 15 Aug 2013 19:22:33 +0000 (19:22 +0000)]
[autotools->cmake] Added CMake support for the preprocessor variable CLANG_REPOSITORY_STRING.
This is a patch in a longer series of patches to add
capabilities/definitions that are present in the Autotools build chain
and not in the CMake build chain to the CMake build chain.
*NOTE* I am hacking on this in my free time. I will annotate each commit
with the [autotools->cmake] header.
llvm-svn: 188478
Aaron Watry [Thu, 15 Aug 2013 19:21:10 +0000 (19:21 +0000)]
Add rhadd builtin
rhadd = (x+y+1)>>1
Implemented as:
(x>>1) + (y>>1) + ((x&1)|(y&1))
This prevents us having to do assembly addition and overflow detection
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 188477
Aaron Watry [Thu, 15 Aug 2013 19:21:07 +0000 (19:21 +0000)]
Add hadd builtin
(x + y) >> 1 gets changed to:
(x>>1) + (y>>1) + (x&y&1)
Saves us having to do any llvm assembly and overflow checking in the addition.
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 188476
David Blaikie [Thu, 15 Aug 2013 18:59:44 +0000 (18:59 +0000)]
DebugInfo: remove unnecessary type registration
This happens in the caller a few frames up anyway.
llvm-svn: 188475
David Blaikie [Thu, 15 Aug 2013 18:59:40 +0000 (18:59 +0000)]
DebugInfo: Don't create duplicate forward declaration metadata unnecessarily.
No functionality change, at best a slight (questionable) optimization,
but necessary for correctness of future work.
llvm-svn: 188474
Fariborz Jahanian [Thu, 15 Aug 2013 18:58:00 +0000 (18:58 +0000)]
Fixes a gross conditional in my last patch.
- This line, and those below, will be ignored--
M lib/ARCMigrate/ObjCMT.cpp
llvm-svn: 188473
Peter Collingbourne [Thu, 15 Aug 2013 18:51:12 +0000 (18:51 +0000)]
DataFlowSanitizer: Add a debugging feature to help us track nonzero labels.
Summary:
When the -dfsan-debug-nonzero-labels parameter is supplied, the code
is instrumented such that when a call parameter, return value or load
produces a nonzero label, the function __dfsan_nonzero_label is called.
The idea is that a debugger breakpoint can be set on this function
in a nominally label-free program to help identify any bugs in the
instrumentation pass causing labels to be introduced.
Reviewers: eugenis
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1405
llvm-svn: 188472
Peter Collingbourne [Thu, 15 Aug 2013 18:51:07 +0000 (18:51 +0000)]
[dfsan] Runtime support for -dfsan-debug-nonzero-labels feature.
Reviewers: eugenis
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1406
llvm-svn: 188471
Fariborz Jahanian [Thu, 15 Aug 2013 18:46:37 +0000 (18:46 +0000)]
ObjectiveC migrator: In deciding NS_OPTION over
NS_ENUM, at least one power of 2 enumerator
must be greater than two.
llvm-svn: 188470
Bill Wendling [Thu, 15 Aug 2013 18:46:14 +0000 (18:46 +0000)]
Constify the function parameters.
llvm-svn: 188469
Jordan Rose [Thu, 15 Aug 2013 17:22:06 +0000 (17:22 +0000)]
[analyzer] If realloc fails on an escaped region, that region doesn't leak.
When a region is realloc()ed, MallocChecker records whether it was known
to be allocated or not. If it is, and the reallocation fails, the original
region has to be freed. Previously, when an allocated region escaped,
MallocChecker completely stopped tracking it, so a failed reallocation
still (correctly) wouldn't require freeing the original region. Recently,
however, MallocChecker started tracking escaped symbols, so that if it were
freed we could check that the deallocator matched the allocator. This
broke the reallocation model for whether or not a symbol was allocated.
Now, MallocChecker will actually check if a symbol is owned, and only
require freeing after a failed reallocation if it was owned before.
PR16730
llvm-svn: 188468
Joey Gouly [Thu, 15 Aug 2013 16:02:44 +0000 (16:02 +0000)]
Drive-by fix for a doxygen comment in MachineInstr.h.
llvm-svn: 188467
Mihai Popa [Thu, 15 Aug 2013 15:43:06 +0000 (15:43 +0000)]
This fixes three issues related to Thumb literal loads:
1. The offset range for Thumb1 PC relative loads is [0..1020] and not [-1024..1020]
2. Thumb2 PC relative loads may define the PC, so the restriction placed on target register is removed
3. Removes unneeded alias between "ldr.n" and t1LDRpci. ".n" is actually stripped by both tablegen
and the ASM parser, so this alias rule really does nothing
llvm-svn: 188466
DeLesley Hutchins [Thu, 15 Aug 2013 15:31:25 +0000 (15:31 +0000)]
Thread safety analysis: move warnings within lock/unlock functions out of beta.
llvm-svn: 188465
Jack Carter [Thu, 15 Aug 2013 15:16:57 +0000 (15:16 +0000)]
[Mips][msa] Add support for half
Add support for half (a.k.a. __fp16) in builtin descriptions.
The second argument to BUILTIN() now accepts 'h' to represent half.
Patch by Daniel Sanders
llvm-svn: 188464
Joerg Sonnenberger [Thu, 15 Aug 2013 15:08:33 +0000 (15:08 +0000)]
Build unwind tables by default on NetBSD.
llvm-svn: 188463
Joerg Sonnenberger [Thu, 15 Aug 2013 15:04:56 +0000 (15:04 +0000)]
Use the integrated assembler on NetBSD/powerpc by default.
llvm-svn: 188462
Jack Carter [Thu, 15 Aug 2013 14:47:02 +0000 (14:47 +0000)]
[Mips][msa] Added most builtins from add.a to xori
Includes:
add.a, adds_a, adds_s, adds_u, addv, addvi, andi.b, asub_[su], ave_[su],
aver_[su], bclr, bclri, bins[lr], bins[lr]i, bmnzi, bmzi, bneg, bnegi, bset,
bseti, c(eq|ne), c(eq|ne)i, cl[et]_[su], cl[et]i_[su], copy_[su].[bhw],
div_[su], dotp_[su], dpadd_[su], dpsub_[su], fadd, fceq, fclass, fcl[et], fcne,
fdiv, fexp2, ffint_[su], ffql, ffqr, fill, flog2, fmadd, fmax, fmax_a, fmin,
fmin_a, fmsub, fmul, frint, fseq, fsle, fslt, fsne, fsqr, fsub, ftint_[su],
ftq, ilvev, ilvl, ilvod, ilvr, ldi, frcp, frsqrt, madd_q, maddr_q, maddv,
max_[asu], maxi_[su], min_[asu], mini_[su], mod_[su], msub_q, msubr_q, msubv,
mul_q, mulr_q, mulv, nloc, nlzc, nori, ori, pckev, pckod, pcnt, sat_[su], shf,
sld, sldi, sll, slli, splat, splati, sr[al], sr[al]i, subs_[su], subv, subvi,
xori
Patch by Daniel Sanders
llvm-svn: 188461
Jack Carter [Thu, 15 Aug 2013 14:22:07 +0000 (14:22 +0000)]
[Mips][msa] Added the simple builtins (madd_q to xori)
Includes:
madd_q, maddr_q, maddv, max_[asu], maxi_[su], min_[asu], mini_[su], mod_[su],
msub_q, msubr_q, msubv, mul_q, mulr_q, mulv, nloc, nlzc, nori, ori, pckev,
pckod, pcnt, sat_[su], shf, sld, sldi, sll, slli, splat, splati, sr[al],
sr[al]i, subs_[su], subss_u, subus_s, subv, subvi, vshf, xori
Patch by Daniel Sanders
llvm-svn: 188460
Evgeniy Stepanov [Thu, 15 Aug 2013 13:57:11 +0000 (13:57 +0000)]
Update sanitizer attribute documentation to match behaviour change in r187967.
llvm-svn: 188459
Jack Carter [Thu, 15 Aug 2013 13:45:36 +0000 (13:45 +0000)]
[Mips][msa] Added the simple builtins (fadd to ftq)
Includes:
fadd, fceq, fcg[et], fclass, fcl[et], fcne, fcun, fdiv, fexdo, fexp2,
fexup[lr], ffint_[su], ffql, ffqr, fill, flog2, fmadd, fmax, fmax_a, fmin,
fmin_a, fmsub, fmul, frint, frcp, frsqrt, fseq, fsge, fsgt, fsle, fslt,
fsne, fsqr, fsub, ftint_s, ftq
Patch by Daniel Sanders
llvm-svn: 188458
Jack Carter [Thu, 15 Aug 2013 12:24:57 +0000 (12:24 +0000)]
[Mips][msa] Added the simple builtins (add_a to dpsub[su], ilvev to ldi)
Includes:
add_a, adds_[asu], addv, addvi, andi.b, asub_[su].[bhwd], aver?_[su]_[bhwd],
bclr, bclri, bins[lr], bins[lr]i, bmnzi, bmzi, bneg, bnegi, bseli, bset, bseti,
c(eq|ne), c(eq|ne)i, cl[et]_[su], cl[et]i_[su], copy_[su].[bhw], div_[su],
dotp_[su], dpadd_[su], dpsub_[su], ilvev, ilvl, ilvod, ilvr, insv, insve,
ldi
Patch by Daniel Sanders
llvm-svn: 188457
Hao Liu [Thu, 15 Aug 2013 11:38:54 +0000 (11:38 +0000)]
Fix the build failure of Realease version
llvm-svn: 188456
Evgeniy Stepanov [Thu, 15 Aug 2013 10:20:30 +0000 (10:20 +0000)]
[sanitizer] Add missing include.
llvm-svn: 188455