This simplifies the complexity of the code that tries to find further operands to merge into the unique command.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258656 91177308-0d34-0410-b5e6-96231b3b80d8
SCCP has code identical to changeToUnreachable's behavior, switch it
over to just call changeToUnreachable.
No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258654 91177308-0d34-0410-b5e6-96231b3b80d8
InstCombine and SCCP both want to remove dead code in a very particular
way but using identical means to do so. Share the code between the two.
No functionality change is intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258653 91177308-0d34-0410-b5e6-96231b3b80d8
A cleanup can have paths which unwind or end up in unreachable.
If there is an unreachable path *and* a path which unwinds to caller,
we would mistakenly inject an unwind path to a catchswitch on the
unreachable path. This results in a verifier assertion firing because
the cleanup unwinds to two different places: to the caller and to the
catchswitch.
This occured because we used getCleanupRetUnwindDest to determine if the
cleanuppad had no cleanuprets.
This is incorrect, getCleanupRetUnwindDest returns null for cleanuprets
which unwind to caller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258651 91177308-0d34-0410-b5e6-96231b3b80d8
Generalised mask generation / subvector extraction to use the input/output types directly instead of an if/else through all the currently accepted types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258645 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
Previously, we would just output "foo = bar" in the assembly, and then
ptxas would choke. Now we die before emitting any invalid code.
Reviewers: echristo
Subscribers: jholewinski, llvm-commits, jhen, tra
Differential Revision: http://reviews.llvm.org/D16490
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258638 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
Update ObjectTransformLayer::addObjectSet to take the object set by
value rather than reference and pass it to the base layer with move
semantics rather than copy, to match r258185's changes to
ObjectLinkingLayer.
Update the unit test to verify that ObjectTransformLayer's signature stays
in sync with ObjectLinkingLayer's.
Reviewers: lhames
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D16414
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258630 91177308-0d34-0410-b5e6-96231b3b80d8
For the moment, this file takes way too long to run (see inline comments), but
that should be a temporary problem. The fact that the compile time is so slow
for a target that doesn't support maskmov may be a bug worth investigating too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258629 91177308-0d34-0410-b5e6-96231b3b80d8
target is macho.
It looks like the check for macho was accidentally dropped in r132959.
I don't have a test case, but I'll add one if anyone knows how this can
be tested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258627 91177308-0d34-0410-b5e6-96231b3b80d8
If the INSERTPS zeroes out all the referenced elements from either of the 2 input vectors (and the input is not already UNDEF), then set that input to UNDEF to reduce dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258622 91177308-0d34-0410-b5e6-96231b3b80d8
Seems like some compilers still give unused variable warnings for
bool var = ...;
(void)var;
so I have to inline the variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258619 91177308-0d34-0410-b5e6-96231b3b80d8
Instead of RAUW with undef, replace the first non-token instruction with
unreachable.
This fixes PR26263.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258611 91177308-0d34-0410-b5e6-96231b3b80d8
PruneEH had functionality idential to removeUnwindEdge.
Consolidate around removeUnwindEdge.
No functionality change is intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258609 91177308-0d34-0410-b5e6-96231b3b80d8
Some of the conditions necessary to produce ccmp sequences were only
checked in recursive calls to emitConjunctionDisjunctionTree() after
some of the earlier expressions were already built. Move all checks over
to isConjunctionDisjunctionTree() so they are all checked before we
start emitting instructions.
Also rename some variable to better reflect their usage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258605 91177308-0d34-0410-b5e6-96231b3b80d8
Previously it failed to add NumArgRegs to the offset and so clobbered an
already-used register. Now just start the numbering after the arg regs
and don't duplicate the add. Test coverage for this coming shortly with
the implementation of byval.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258597 91177308-0d34-0410-b5e6-96231b3b80d8
Running mt.exe to make the manifest is really slow. Disabling manifest
generation doesn't seem to break anything.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258581 91177308-0d34-0410-b5e6-96231b3b80d8
Cleanups in C++ are a little weird. They are only guaranteed to be
reliably executed if, and only if, there is a viable catch handler which
can handle the exception.
This means that reachability of a cleanup is lexically determined by it
being nested with a try-block which unwinds to a catch. It is *cannot*
be reasoned about by examining the control flow edges leaving a cleanup.
Usually this is not a problem. It becomes a problem when there are *no*
edges out of a cleanup because we believed that code post-dominated by
the cleanup is dead. In LLVM's case, this code is what informs the
personality routine about the presence of a suitable catch handler.
However, the lack of edges to that catch handler makes the handler
become unreachable which causes us to remove it. By removing the
handler, the cleanup becomes unreachable.
Instead, inject a catch-all handler with every cleanup that has no
unwind edges. This will allow us to properly unwind the stack.
This fixes PR25997.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258580 91177308-0d34-0410-b5e6-96231b3b80d8
in MachOObjectFile::getSymbolByIndex() when a Mach-O file has
a symbol table load command but the number of symbols are zero.
The code in MachOObjectFile::symbol_begin_impl() should not be
assuming there is a symbol at index 0, in cases there is no symbol
table load command or the count of symbol is zero. So I also fixed
that. And needed to fix MachOObjectFile::symbol_end_impl() to
also do the same thing for no symbol table or one with zero entries.
The code in MachOObjectFile::getSymbolByIndex() should trigger
the report_fatal_error() for programmatic errors for any index when
there is no symbol table load command and not return the end iterator.
So also fixed that. Note there is no test case as this is a programmatic
error.
The test case using the file macho-invalid-bad-symbol-index has
a symbol table load command with its number of symbols (nsyms)
is zero. Which was incorrectly testing the bad triggering of the
report_fatal_error() in in MachOObjectFile::getSymbolByIndex().
This test case is an invalid Mach-O file but not for that reason.
It appears this Mach-O file use to have an nsyms value of 11,
and what makes this Mach-O file invalid is the counts and
indexes into the symbol table of the dynamic load command
are now invalid because the number of symbol table entries
(nsyms) is now zero. Which can be seen with the existing
llvm-obdump:
% llvm-objdump -private-headers macho-invalid-bad-symbol-index
…
Load command 4
cmd LC_SYMTAB
cmdsize 24
symoff 4216
nsyms 0
stroff 4392
strsize 144
Load command 5
cmd LC_DYSYMTAB
cmdsize 80
ilocalsym 0
nlocalsym 8 (past the end of the symbol table)
iextdefsym 8 (greater than the number of symbols)
nextdefsym 2 (past the end of the symbol table)
iundefsym 10 (greater than the number of symbols)
nundefsym 1 (past the end of the symbol table)
...
And the native darwin tools generates an error for this file:
% nm macho-invalid-bad-symbol-index
nm: object: macho-invalid-bad-symbol-index truncated or malformed object (ilocalsym plus nlocalsym in LC_DYSYMTAB load command extends past the end of the symbol table)
I added new checks for the indexes and sizes for these in the
constructor of MachOObjectFile. And added comments for what
would be a proper diagnostic messages.
And changed the test case using macho-invalid-bad-symbol-index
to test for the new error now produced.
Also added a test with a valid Mach-O file with a symbol table
load command where the number of symbols is zero that shows
the report_fatal_error() is not called.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258576 91177308-0d34-0410-b5e6-96231b3b80d8