Daniel Jasper [Wed, 12 Aug 2015 08:13:39 +0000 (08:13 +0000)]
Revert "Revised test to pass under updated dtor callback implementation"
This breaks the buildbot:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/19656
llvm-svn: 244724
Simon Pilgrim [Wed, 12 Aug 2015 08:08:56 +0000 (08:08 +0000)]
[InstCombine] Move SSE/AVX vector blend folding to instcombiner
As discussed in D11886, this patch moves the SSE/AVX vector blend folding to instcombiner from PerformINTRINSIC_WO_CHAINCombine (which allows us to remove this completely).
InstCombiner already had partial support for this, I just had to add support for zero (ConstantAggregateZero) masks and also the case where both selection inputs were the same (allowing us to ignore the mask).
I also moved all the relevant combine tests into InstCombine/blend_x86.ll
Differential Revision: http://reviews.llvm.org/D11934
llvm-svn: 244723
Manuel Klimek [Wed, 12 Aug 2015 07:57:16 +0000 (07:57 +0000)]
Reinstantiate better diagnostic, this time with a fatal error so we don't add a dependency onto gtest from the header.
llvm-svn: 244722
Tobias Grosser [Wed, 12 Aug 2015 07:48:54 +0000 (07:48 +0000)]
Always model PHI nodes in scop (if not in same nonaffine subregion)
Before we only modeled PHI nodes if at least one incoming basic block was itself
part of the region, now we always model them except if all of their operands are
part of a single non-affine subregion which we model as a black-box.
This change only affects PHI nodes in the entry block, that have exactly one
incoming edge. Before this change, we did not model them and as a result code
generation would not know how to code generate them. With this change, code
generation can code generate them like any other PHI node.
This issue was exposed by r244606. Before this change simplifyRegion would have
moved these PHI nodes out of the SCoP, so we would never have tried to code
generate them. We could implement this behavior again, but changing the IR
after the scop has been modeled and transformed always adds a risk of us
invalidating earlier analysis results. It seems more save and overall also more
consistent to just model and handle this one-entry-edge PHI nodes like any
other PHI node in the scop.
Solution proposed by: Michael Kruse <llvm@meinersbur.de>
llvm-svn: 244721
Michael Kruse [Wed, 12 Aug 2015 07:34:55 +0000 (07:34 +0000)]
Add another test case with trival PHI in entry BB
This one was extracted from the test-suite's pifft and caused a
miscompilation because a scalar was not written to its alloca address.
llvm-svn: 244720
Alexey Bataev [Wed, 12 Aug 2015 07:10:54 +0000 (07:10 +0000)]
[OPENMP] Fix for llvm.org/PR24430: clang hangs on invalid input with openmp directive
Add parsing of openmp directives inside structs/unions in C mode.
llvm-svn: 244719
Craig Topper [Wed, 12 Aug 2015 06:43:10 +0000 (06:43 +0000)]
[TableGen] Remove unused constructor.
llvm-svn: 244718
Eric Fiselier [Wed, 12 Aug 2015 06:36:19 +0000 (06:36 +0000)]
Fix CMake error whet llvm-config reports a non-existent source directory.
llvm-svn: 244717
Jason Molenda [Wed, 12 Aug 2015 03:27:33 +0000 (03:27 +0000)]
Have debugserver send the OS version string plus
major, minor, and patchlevel in the qHostInfo reply.
Document that qHostInfo may report major/minor/patch
separately / in addition to the version: combination.
<rdar://problem/
22125465>
llvm-svn: 244716
Saleem Abdulrasool [Wed, 12 Aug 2015 03:21:44 +0000 (03:21 +0000)]
libclang: Add period to typedef kind docblock
All of the other docblocks for the CXCursor_* cursor kind enum values
include documentation that ends with a period. Add a period to the end
of the CXCursor_TypedefDecl documentation to follow this convention.
Patch by Brian Gesiak!
llvm-svn: 244715
Richard Smith [Wed, 12 Aug 2015 02:17:52 +0000 (02:17 +0000)]
[modules] Fix thread safety analysis to cope with merging of FieldDecls across modules.
llvm-svn: 244714
Saleem Abdulrasool [Wed, 12 Aug 2015 02:01:36 +0000 (02:01 +0000)]
X86: hoist a condition into a variable (NFC)
The same value is used multiple times through the function. Hoist the condition
into a variable. This should fix a silly static analysis warning where the
conditions flip around. No functional change intended.
llvm-svn: 244713
Kostya Serebryany [Wed, 12 Aug 2015 01:55:37 +0000 (01:55 +0000)]
[libFuzzer] add two flags, -tbm_depth and -tbm_width to control how the trace-based-mutations are applied
llvm-svn: 244712
Rafael Espindola [Wed, 12 Aug 2015 01:45:28 +0000 (01:45 +0000)]
Fix the alignment of the section headers.
Thanks a lot to Rui for noticing it.
llvm-svn: 244711
Chaoren Lin [Wed, 12 Aug 2015 01:22:24 +0000 (01:22 +0000)]
Export snprintf to avoid linking error with liblldb on Windows.
Reviewers: zturner, ovyalov
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11967
llvm-svn: 244710
Naomi Musgrave [Wed, 12 Aug 2015 01:15:28 +0000 (01:15 +0000)]
Revised test to pass under updated dtor callback implementation
Summary: New implementation for dtor sanitizer callback poisons only class members, and emits poisoning callback before base dtor invoked.
Reviewers: eugenis, kcc
Differential Revision: http://reviews.llvm.org/D11952
Explicit dtor invocation
llvm-svn: 244709
Kostya Serebryany [Wed, 12 Aug 2015 01:04:27 +0000 (01:04 +0000)]
[libFuzzer] add colons to the stats output to avoid confusion
llvm-svn: 244708
Kostya Serebryany [Wed, 12 Aug 2015 00:55:09 +0000 (00:55 +0000)]
[libFuzzer] use raw C IO to reduce the risk of a deadlock in a signal handler.
llvm-svn: 244707
Piotr Padlewski [Wed, 12 Aug 2015 00:47:19 +0000 (00:47 +0000)]
Deleted old fixme ( ͡° ͜ʖ ͡°)
http://reviews.llvm.org/D11928
llvm-svn: 244706
Sanjay Patel [Wed, 12 Aug 2015 00:29:10 +0000 (00:29 +0000)]
[x86] enable machine combiner reassociations for 256-bit vector FP mul/add
llvm-svn: 244705
Adam Nemet [Wed, 12 Aug 2015 00:21:59 +0000 (00:21 +0000)]
[LoopDist] Add test for missing coverage
Add a testcase to ensure that if we can't find bounds for a necessary
memcheck we don't distribute.
llvm-svn: 244703
Rafael Espindola [Wed, 12 Aug 2015 00:00:24 +0000 (00:00 +0000)]
ELF: Create a string table.
For now only the sections are in it, but it already makes the output easier
to read and test.
llvm-svn: 244702
Rui Ueyama [Tue, 11 Aug 2015 23:37:25 +0000 (23:37 +0000)]
ELF2: Make Defined{Regular,Weak} ctors look the same as other SymbolBody ctors.
llvm-svn: 244701
Rafael Espindola [Tue, 11 Aug 2015 23:34:29 +0000 (23:34 +0000)]
Template ELF's OutputSection.
This removes what I think is the last hard coded ELF64 structure.
llvm-svn: 244700
Chris Bieneman [Tue, 11 Aug 2015 23:31:43 +0000 (23:31 +0000)]
NFC. Fixing a red squiggly line in my editor.
llvm-svn: 244699
Alex Lorenz [Tue, 11 Aug 2015 23:23:17 +0000 (23:23 +0000)]
PseudoSourceValue: Transform the mips subclass to target independent subclasses
This commit transforms the mips-specific 'MipsCallEntry' subclass of the
'PseudoSourceValue' class into two, target-independent subclasses named
'GlobalValuePseudoSourceValue' and 'ExternalSymbolPseudoSourceValue'.
This change makes it easier to serialize the pseudo source values by removing
target-specific pseudo source values.
Reviewers: Akira Hatanaka
llvm-svn: 244698
Rafael Espindola [Tue, 11 Aug 2015 23:22:24 +0000 (23:22 +0000)]
Move more code that is local to Writer.cpp to an anonymous namespace.
llvm-svn: 244697
Rafael Espindola [Tue, 11 Aug 2015 23:19:06 +0000 (23:19 +0000)]
Delete dead code.
llvm-svn: 244696
Eric Christopher [Tue, 11 Aug 2015 23:17:31 +0000 (23:17 +0000)]
Untabify.
llvm-svn: 244695
Rafael Espindola [Tue, 11 Aug 2015 23:14:13 +0000 (23:14 +0000)]
Be a bit more consistent about using uintX_t for offsets and sizes. NFC.
llvm-svn: 244694
Alex Lorenz [Tue, 11 Aug 2015 23:09:45 +0000 (23:09 +0000)]
PseudoSourceValue: Replace global manager with a manager in a machine function.
This commit removes the global manager variable which is responsible for
storing and allocating pseudo source values and instead it introduces a new
manager class named 'PseudoSourceValueManager'. Machine functions now own an
instance of the pseudo source value manager class.
This commit also modifies the 'get...' methods in the 'MachinePointerInfo'
class to construct pseudo source values using the instance of the pseudo
source value manager object from the machine function.
This commit updates calls to the 'get...' methods from the 'MachinePointerInfo'
class in a lot of different files because those calls now need to pass in a
reference to a machine function to those methods.
This change will make it easier to serialize pseudo source values as it will
enable me to transform the mips specific MipsCallEntry PseudoSourceValue
subclass into two target independent subclasses.
Reviewers: Akira Hatanaka
llvm-svn: 244693
Michael Kruse [Tue, 11 Aug 2015 23:09:19 +0000 (23:09 +0000)]
Add test case for entry node with trivial PHI
This is a break-down from the test-suite's oggenc where Polly currently
crashes.
llvm-svn: 244692
Rui Ueyama [Tue, 11 Aug 2015 23:09:00 +0000 (23:09 +0000)]
COFF: Align sections to 512-byte boundaries on disk.
Sections must start at page boundaries in memory, but they
can be aligned to sector boundaries (512-bytes) on disk.
We aligned them to 4096-byte boundaries even on disk, so we
wasted disk space a bit.
llvm-svn: 244691
Adam Nemet [Tue, 11 Aug 2015 23:03:09 +0000 (23:03 +0000)]
[LAA] Fix typo in test
llvm-svn: 244690
Greg Clayton [Tue, 11 Aug 2015 22:53:00 +0000 (22:53 +0000)]
ClangASTType is now CompilerType.
This is more preparation for multiple different kinds of types from different compilers (clang, Pascal, Go, RenderScript, Swift, etc).
llvm-svn: 244689
Alex Lorenz [Tue, 11 Aug 2015 22:32:00 +0000 (22:32 +0000)]
PseudoSourceValue: Introduce a 'PSVKind' enumerator.
This commit introduces a new enumerator named 'PSVKind' in the
'PseudoSourceValue' class. This enumerator is now used to distinguish between
the various kinds of pseudo source values.
This change is done in preparation for the changes to the pseudo source value
object management and to the PseudoSourceValue's class hierarchy - the next two
PseudoSourceValue commits will get rid of the global variable that manages the
pseudo source values and the mips specific MipsCallEntry subclass.
Reviewers: Akira Hatanaka
llvm-svn: 244687
Alex Lorenz [Tue, 11 Aug 2015 22:23:19 +0000 (22:23 +0000)]
PseudoSourceValue: Update comments and fix lowercase variable names. NFC.
This commit updates the documentation comments in PseudoSourceValue.cpp and
PseudoSourceValue.h based on the LLVM's documentation style. It also fixes
several instances of variable names that started with a lowercase letter.
This change is done in preparation for the changes to the pseudo source value
object management and to the PseudoSourceValue's class hierarchy.
llvm-svn: 244686
Alex Lorenz [Tue, 11 Aug 2015 22:17:22 +0000 (22:17 +0000)]
Reformat PseudoSourceValue.cpp and PseudoSourceValue.h. NFC.
This commit reformats the files lib/CodeGen/PseudoSourceValue.cpp and
include/llvm/CodeGen/PseudoSourceValue.h using clang-format. This change is
done in preparation for the changes to the pseudo source value object
management and to the PseudoSourceValue's class hierarchy.
llvm-svn: 244685
Mark Heffernan [Tue, 11 Aug 2015 22:16:34 +0000 (22:16 +0000)]
Use 32-bit divides instead of 64-bit divides where possible.
For NVPTX, try to use 32-bit division instead of 64-bit division when the dividend and divisor
fit in 32 bits. This speeds up some internal benchmarks significantly. The underlying reason
is that many index computations are carried out in 64-bits but never actually exceed the
capacity of a 32-bit word.
llvm-svn: 244684
Greg Clayton [Tue, 11 Aug 2015 22:07:46 +0000 (22:07 +0000)]
Fix a infinite loop when killing a process that is in the middle of loading shared libraries.
The issue was we were sending a "qSymbol::" packet and it we were already disconnected were weren't exiting the while loop if we didn't successfully send the qSymbol packet.
<rdar://problem/
22098746>
llvm-svn: 244683
Richard Smith [Tue, 11 Aug 2015 22:00:24 +0000 (22:00 +0000)]
[modules] When instantiating the contents of an imported CXXRecordDecl, we can
emit lexical contents for a declaration for another module. Track which module
those contents came from, and ensure that we only grab the lexical contents
from a single such instantiation.
llvm-svn: 244682
Greg Clayton [Tue, 11 Aug 2015 21:49:32 +0000 (21:49 +0000)]
Added missing files from checking regarding:
http://reviews.llvm.org/D8712
llvm-svn: 244681
Rui Ueyama [Tue, 11 Aug 2015 21:45:55 +0000 (21:45 +0000)]
ELF2: Remove unused global variable.
A global variable "Driver" is to re-entry to the driver to parse a
.drectve section. Because the need is COFF-specific, we don't need
this variable for ELF.
llvm-svn: 244680
Greg Clayton [Tue, 11 Aug 2015 21:38:15 +0000 (21:38 +0000)]
First step in getting LLDB ready to support multiple different type systems.
This is the work done by Ryan Brown from http://reviews.llvm.org/D8712 that makes a TypeSystem class and abstracts types to be able to use a type system.
All tests pass on MacOSX and passed on linux the last time this was submitted.
llvm-svn: 244679
Paul Robinson [Tue, 11 Aug 2015 21:36:45 +0000 (21:36 +0000)]
Make DW_AT_[MIPS_]linkage_name optional, and off by default for SCE.
Mangled "linkage" names can be huge, and if the debugger (or other
tools) have no use for them, the size savings can be very impressive
(on the order of 40%).
Add one test for controlling behavior, and modify a number of tests to
either stop using linkage names, or make llc emit them (so these tests
will still run when the default triple is for PS4).
Differential Revision: http://reviews.llvm.org/D11374
llvm-svn: 244678
Jonathan Peyton [Tue, 11 Aug 2015 21:36:41 +0000 (21:36 +0000)]
Tidy statistics collection
This removes some statistics counters and timers which were not used,
adds new counters and timers for some language features that were not
monitored previously and separates the counters and timers into those
which are of interest for investigating user code and those which are
only of interest to the developer of the runtime itself.
The runtime developer statistics are now ony collected if the
additional #define KMP_DEVELOPER_STATS is set.
Additional user statistics which are now collected include:
* Count of nested parallelism (omp parallel inside a parallel region)
* Count of omp distribute occurrences
* Count of omp teams occurrences
* Counts of task related statistics (taskyield, task execution, task
cancellation, task steal)
* Values passed to omp_set_numtheads
* Time spent in omp single and omp master
None of this affects code compiled without stats gathering enabled,
which is the normal library build mode.
This also fixes the CMake build by linking to the standard c++ library
when building the stats library as it is a requirement. The normal library
does not have this requirement and its link phase is left alone.
Differential Revision: http://reviews.llvm.org/D11759
llvm-svn: 244677
Sanjoy Das [Tue, 11 Aug 2015 21:33:55 +0000 (21:33 +0000)]
Fix PR24354.
`InstCombiner::OptimizeOverflowCheck` was asserting an
invariant (operands to binary operations are ordered by decreasing
complexity) that wasn't really an invariant. Fix this by instead having
`InstCombiner::OptimizeOverflowCheck` establish the invariant if it does
not hold.
llvm-svn: 244676
Petar Jovanovic [Tue, 11 Aug 2015 21:27:39 +0000 (21:27 +0000)]
[MIPS] Use arch values for lock-free atomic operations
Let NaClMips32ELTargetInfo inherit arch values for maximum width lock-free
atomic operations.
Differential Revision: http://reviews.llvm.org/D11949
llvm-svn: 244675
Reid Kleckner [Tue, 11 Aug 2015 21:24:59 +0000 (21:24 +0000)]
[lit] Don't disable the lit progress bar by default with MSVC
Only disable the progress bar when we're generating VS project files,
like we do for XCode. This makes lit use the simple, non-curses progress
bar that looks like this with:
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Testing Time: 5.87s
llvm-svn: 244674
Anton Yartsev [Tue, 11 Aug 2015 21:24:19 +0000 (21:24 +0000)]
[analyzer] Incorrect env variable replaced.
llvm-svn: 244673
Sanjay Patel [Tue, 11 Aug 2015 21:24:04 +0000 (21:24 +0000)]
don't repeat function names in comments; NFC
llvm-svn: 244672
Richard Smith [Tue, 11 Aug 2015 21:21:20 +0000 (21:21 +0000)]
Add an assert to catch lexical decl deserialization bugs.
llvm-svn: 244671
Aaron Ballman [Tue, 11 Aug 2015 21:17:53 +0000 (21:17 +0000)]
Fixing a few C++0x comments to be C++11; NFC.
llvm-svn: 244670
Aaron Ballman [Tue, 11 Aug 2015 21:12:46 +0000 (21:12 +0000)]
Add missing documentation for conversionDecl; NFC.
llvm-svn: 244669
Sanjay Patel [Tue, 11 Aug 2015 21:11:56 +0000 (21:11 +0000)]
fix 80-cols; NFC
llvm-svn: 244668
JF Bastien [Tue, 11 Aug 2015 21:10:07 +0000 (21:10 +0000)]
NFC SelectionDAGDumper: fix typo
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11959
llvm-svn: 244667
Aaron Ballman [Tue, 11 Aug 2015 21:09:52 +0000 (21:09 +0000)]
Add a polymorphic AST matcher for testing whether a constructor or a conversion declaration is marked as explicit or not.
llvm-svn: 244666
JF Bastien [Tue, 11 Aug 2015 21:02:46 +0000 (21:02 +0000)]
WebAssembly: implement comparison.
Some of the FP comparisons (ueq, one, ult, ule, ugt, uge) are currently broken, I'll fix them in a follow-up.
Reviewers: sunfish
Subscribers: llvm-commits, jfb
Differential Revision: http://reviews.llvm.org/D11924
llvm-svn: 244665
Greg Clayton [Tue, 11 Aug 2015 21:01:32 +0000 (21:01 +0000)]
Don't crash if the file we want to touch doesn't exist.
llvm-svn: 244663
Aaron Ballman [Tue, 11 Aug 2015 20:42:00 +0000 (20:42 +0000)]
Add an AST matcher to match member intializers of a CXXCtorInitializer.
llvm-svn: 244662
Kostya Serebryany [Tue, 11 Aug 2015 20:34:48 +0000 (20:34 +0000)]
[libFuzzer] more trophies
llvm-svn: 244661
Daniel Jasper [Tue, 11 Aug 2015 20:32:24 +0000 (20:32 +0000)]
clang-format: Make SpaceBeforeParens work with overloaded operators.
Patch by Jon Chesterfield, thank you!
llvm-svn: 244660
Reid Kleckner [Tue, 11 Aug 2015 20:28:28 +0000 (20:28 +0000)]
[cmake] Shorten FreeBSD and DragonFly checks as suggested post-commit
NFC
llvm-svn: 244659
David Blaikie [Tue, 11 Aug 2015 20:21:45 +0000 (20:21 +0000)]
Revert the diagnostic improvements in r244602 as they introduced a problematic dependency
Seems we had some internal uses that include ClangTidyTest.h and weren't
ready for a gtest dependency. Reverting to give Manuel some time to look
into it.
llvm-svn: 244658
Sanjay Patel [Tue, 11 Aug 2015 20:19:23 +0000 (20:19 +0000)]
[x86] enable machine combiner reassociations for 128-bit vector single/double multiplies
llvm-svn: 244657
Chen Li [Tue, 11 Aug 2015 20:16:17 +0000 (20:16 +0000)]
[LowerSwitch] Skip dead blocks for processSwitchInst()
Summary: This patch adds check for dead blocks and skip them for processSwitchInst(). This will help reduce compilation time.
Reviewers: reames, hans
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11953
llvm-svn: 244656
JF Bastien [Tue, 11 Aug 2015 20:13:18 +0000 (20:13 +0000)]
WebAssembly: implement WebAssemblyTargetLowering::getTargetNodeName
Summary: Implementation is the same as in AArch64.
Subscribers: aemerson, jfb, llvm-commits, sunfish
Differential Revision: http://reviews.llvm.org/D11956
llvm-svn: 244655
Reid Kleckner [Tue, 11 Aug 2015 20:06:51 +0000 (20:06 +0000)]
Fix mismatched sign comparison
llvm-svn: 244653
Sanjay Patel [Tue, 11 Aug 2015 19:39:36 +0000 (19:39 +0000)]
fix minsize detection: minsize attribute implies optimizing for size
Also, add a test for optsize because this was not part of any existing regression test.
llvm-svn: 244651
David Majnemer [Tue, 11 Aug 2015 19:25:13 +0000 (19:25 +0000)]
[MSVC Compatibility] Classify ext_ms_cast_fn_obj as DefaultError
This non-conforming extension was introduced to make it possible for us
to correctly compile <atomic> in VS 2013 and 2015. Let's limit its
impact to system headers to encourage portable code.
llvm-svn: 244650
Jingyue Wu [Tue, 11 Aug 2015 19:21:46 +0000 (19:21 +0000)]
SelectionDAG: Prefer to combine multiplication with less uses for fma
Summary:
For example:
s6 = s0*s5;
s2 = s6*s6 + s6;
...
s4 = s6*s3;
We notice that it is possible for s2 is folded to fma (s0, s5, fmul (s6 s6)).
This only happens when Aggressive is true, otherwise hasOneUse() check
already prevents from folding the multiplication with more uses.
Test Plan: test/CodeGen/NVPTX/fma-assoc.ll
Patch by Xuetian Weng
Reviewers: hfinkel, apazos, jingyue, ohsallen, arsenm
Subscribers: arsenm, jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D11855
llvm-svn: 244649
Reid Kleckner [Tue, 11 Aug 2015 19:02:57 +0000 (19:02 +0000)]
Revert "[cmake] Add helper for finding potentially external projects"
This reverts commit r244633.
We aren't going to be able to use it because the compiler-rt build can
be built standalone without an LLVM source dir *or* an installed copy of
LLVM.
llvm-svn: 244648
Reid Kleckner [Tue, 11 Aug 2015 18:43:13 +0000 (18:43 +0000)]
Revert the rest of r244634, since it breaks the standalone build
compiler-rt can apparently be built without an installed copy of LLVM,
so we can't call its cmake code.
llvm-svn: 244647
Daniel Sanders [Tue, 11 Aug 2015 18:40:02 +0000 (18:40 +0000)]
[ubsan][mips] Revise r243384 to avoid special casing big-endian mips.
Account for the case when uptr is 32-bit instead of trying to fix this case
using the little endian path.
llvm-svn: 244646
Reid Kleckner [Tue, 11 Aug 2015 18:29:32 +0000 (18:29 +0000)]
Include sanitizer_posix.h to try to fix the mac build
Linux must pick it up transitively.
llvm-svn: 244645
David Blaikie [Tue, 11 Aug 2015 18:17:45 +0000 (18:17 +0000)]
Fix UB in MCJIT test cases that relied on union type punning
Reviewers: lhames, aaron.ballman
Differential Revision: http://reviews.llvm.org/D11779
llvm-svn: 244644
Justin Bogner [Tue, 11 Aug 2015 18:17:41 +0000 (18:17 +0000)]
Re-apply "cmake: Make CMAKE_BUILD_TYPE check case-insensitive"
This re-applies r244516 (effectively reverting r244516) without losing
the check that caused failures for VS.
llvm-svn: 244643
Chen Li [Tue, 11 Aug 2015 18:12:26 +0000 (18:12 +0000)]
[LowerSwitch] Fix a bug when LowerSwitch deletes the default block
Summary: LowerSwitch crashed with the attached test case after deleting the default block. This happened because the current implementation of deleting dead blocks is wrong. After the default block being deleted, it contains no instruction or terminator, and it should no be traversed anymore. However, since the iterator is advanced before processSwitchInst() function is executed, the block advanced to could be deleted inside processSwitchInst(). The deleted block would then be visited next and crash dyn_cast<SwitchInst>(Cur->getTerminator()) because Cur->getTerminator() returns a nullptr. This patch fixes this problem by recording dead default blocks into a list, and delete them after all processSwitchInst() has been done. It still possible to visit dead default blocks and waste time process them. But it is a compile time issue, and I plan to have another patch to add support to skip dead blocks.
Reviewers: kariddi, resistor, hans, reames
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11852
llvm-svn: 244642
Rafael Espindola [Tue, 11 Aug 2015 18:11:17 +0000 (18:11 +0000)]
Use llvm::make_unique to fix the MSVC build.
llvm-svn: 244641
Rafael Espindola [Tue, 11 Aug 2015 17:57:05 +0000 (17:57 +0000)]
Add support for weak undefined symbols.
llvm-svn: 244640
Rafael Espindola [Tue, 11 Aug 2015 17:51:57 +0000 (17:51 +0000)]
Remove unused templating.
llvm-svn: 244639
Reid Kleckner [Tue, 11 Aug 2015 17:36:09 +0000 (17:36 +0000)]
[windows] Use lld-link instead of lld-link2, the latter no longer exists
The test passed for me locally because I had a stale copy of
lld-link2.exe.
llvm-svn: 244638
Yaron Keren [Tue, 11 Aug 2015 17:35:49 +0000 (17:35 +0000)]
Add SmallString test trying to exercise the realloc() code path
by allocating a small size (will go through malloc) and then large size.
llvm-svn: 244637
Rafael Espindola [Tue, 11 Aug 2015 17:33:02 +0000 (17:33 +0000)]
Add support for weak symbols.
llvm-svn: 244636
Reid Kleckner [Tue, 11 Aug 2015 17:22:06 +0000 (17:22 +0000)]
Revert part of the last cmake change, it broke configuring with libcxx on Linux for me
llvm-svn: 244635
Reid Kleckner [Tue, 11 Aug 2015 17:18:23 +0000 (17:18 +0000)]
[cmake] Handle external source for lld and libcxx
As requested in post-commit review of r244549.
llvm-svn: 244634
Reid Kleckner [Tue, 11 Aug 2015 17:16:35 +0000 (17:16 +0000)]
[cmake] Add helper for finding potentially external projects
I plan to use this from compiler-rt, but it's useful for any LLVM
project that depends on more than just LLVM.
llvm-svn: 244633
Rafael Espindola [Tue, 11 Aug 2015 17:10:02 +0000 (17:10 +0000)]
Use real values for DefindeFirst and DefinedLast.
With this clang notices that switches are fully covered.
llvm-svn: 244632
Sanjay Patel [Tue, 11 Aug 2015 17:04:31 +0000 (17:04 +0000)]
fix minsize detection: minsize attribute implies optimizing for size
llvm-svn: 244631
Sanjay Patel [Tue, 11 Aug 2015 16:58:49 +0000 (16:58 +0000)]
add missing tests for powi expansion with size optimizations
The minsize test will be fixed in the next commit.
llvm-svn: 244630
Reid Kleckner [Tue, 11 Aug 2015 16:56:26 +0000 (16:56 +0000)]
[windows] Remove CHECK for strdup symbol that comes from the CRT
llvm-symbolizer isn't symbolizing it for some reason. I'll investigate.
llvm-svn: 244629
Rafael Espindola [Tue, 11 Aug 2015 16:55:28 +0000 (16:55 +0000)]
Delete unused typedef.
llvm-svn: 244628
Sanjay Patel [Tue, 11 Aug 2015 16:51:31 +0000 (16:51 +0000)]
fixed to use FileCheck
llvm-svn: 244627
Rui Ueyama [Tue, 11 Aug 2015 16:46:08 +0000 (16:46 +0000)]
COFF: Ignore /editandcontinue option.
llvm-svn: 244626
Sanjay Patel [Tue, 11 Aug 2015 16:43:18 +0000 (16:43 +0000)]
fixed to test attribute, rather than CPU
llvm-svn: 244625
Rafael Espindola [Tue, 11 Aug 2015 16:30:34 +0000 (16:30 +0000)]
Don't report a conflict between two local symbols.
llvm-svn: 244624
Reid Kleckner [Tue, 11 Aug 2015 16:30:27 +0000 (16:30 +0000)]
Speculative fix for Mac build
llvm-svn: 244623
Teresa Johnson [Tue, 11 Aug 2015 16:26:41 +0000 (16:26 +0000)]
Enable EliminateAvailableExternally pass in the LTO pipeline.
Summary:
For LTO we need to enable this pass in the LTO pipeline,
as it is skipped during the "-flto -c" compile step (when PrepareForLTO is
set).
Reviewers: rnk
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11919
llvm-svn: 244622
Rafael Espindola [Tue, 11 Aug 2015 16:26:06 +0000 (16:26 +0000)]
Revert "Add non-member begin and end so that drop_begin works on iterator_range."
This reverts commit r244620.
MSVC doesn't like it :-(
llvm-svn: 244621
Rafael Espindola [Tue, 11 Aug 2015 16:12:56 +0000 (16:12 +0000)]
Add non-member begin and end so that drop_begin works on iterator_range.
llvm-svn: 244620