R600/SI: Custom select 64-bit ADD

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202194 91177308-0d34-0410-b5e6-96231b3b80d8
R600: Don't unconditionally unroll loops with private memory accesses

This causes the size of the scrypt kernel to explode and eats all the
memory on some systems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202195 91177308-0d34-0410-b5e6-96231b3b80d8
[reassociate] Switch two std::sort calls into std::stable_sort calls as
their inputs come from std::stable_sort and they are not total orders.

I'm not a huge fan of this, but the really bad std::stable_sort is right
at the beginning of Reassociate. After we commit to stable-sort based
consistent respect of source order, the downstream sorts shouldn't undo
that unless they have a total order or they are used in an
order-insensitive way. Neither appears to be true for these cases.
I don't have particularly good test cases, but this jumped out by
inspection when looking for output instability in this pass due to
changes in the ordering of std::sort.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202196 91177308-0d34-0410-b5e6-96231b3b80d8
Fix resetting the DataLayout in a Module.

No tool does this currently, but as everything else in a module we should be
able to change its DataLayout.

Most of the fix is in DataLayout to make sure it can be reset properly.

The test uses Module::setDataLayout since the fact that we mutate a DataLayout
is an implementation detail. The module could hold a OwningPtr<DataLayout> and
the DataLayout itself could be immutable.

Thanks to Philip Reames for pushing me in the right direction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202198 91177308-0d34-0410-b5e6-96231b3b80d8
Address review comments for r202188.
This is refactoring / simplifying code, updating comments and enabling the
testcase on non-x86 platforms.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202199 91177308-0d34-0410-b5e6-96231b3b80d8
DwarfDebug: Avoid emitting an empty debug_aranges section when aranges are disabled

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202201 91177308-0d34-0410-b5e6-96231b3b80d8
Attempt to unbreak an MSVC buildbot by switching to %llc_dwarf.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202202 91177308-0d34-0410-b5e6-96231b3b80d8
Use DataLayout from the module when easily available.

Eventually DataLayoutPass should go away, but for now that is the only easy
way to get a DataLayout in some APIs. This patch only changes the ones that
have easy access to a Module.

One interesting issue with sometimes using DataLayoutPass and sometimes
fetching it from the Module is that we have to make sure they are equivalent.
We can get most of the way there by always constructing the pass with a Module.
In fact, the pass could be changed to point to an external DataLayout instead
of owning one to make this stricter.

Unfortunately, the C api passes a DataLayout, so it has to be up to the caller
to make sure the pass and the module are in sync.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202204 91177308-0d34-0410-b5e6-96231b3b80d8
fix crash in SmallDenseMap copy constructor

Prevent a crash in the SmallDenseMap copy constructor whenever the other
map is not in small mode.

<rdar://problem/14292693>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202206 91177308-0d34-0410-b5e6-96231b3b80d8
Add DIUnspecifiedParameter, so we can pretty-print it.
This will be used for testcases in CFE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202207 91177308-0d34-0410-b5e6-96231b3b80d8
Exception handling docs: Describe landingpad clauses' meanings in more detail

The original text is very terse, so I've expanded on it.

Specifically, in the original text:

 * "The selector value is a positive number if the exception matched a
   type info" -- It wasn't clear that this meant "if the exception
   matched a 'catch' clause".

 * "If nothing is matched, the behavior of the program is
   `undefined`_."  -- It's actually implementation-defined in C++
   rather than undefined, as the new text explains.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202209 91177308-0d34-0410-b5e6-96231b3b80d8
Simplify base64 routine a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202210 91177308-0d34-0410-b5e6-96231b3b80d8
Constify the Optnone checks in IR passes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202213 91177308-0d34-0410-b5e6-96231b3b80d8
Delete two declared overloads of CallInst::CallInst that are never defined or used. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202218 91177308-0d34-0410-b5e6-96231b3b80d8
Formatting fixups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202220 91177308-0d34-0410-b5e6-96231b3b80d8
80-col.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202221 91177308-0d34-0410-b5e6-96231b3b80d8
Remove spurious emacs major mode marker, these should only go on .h files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202222 91177308-0d34-0410-b5e6-96231b3b80d8
[SROA] Fix PR18615 with some long overdue simplifications to the bounds
checking in SROA.

The primary change is to just rely on uge for checking that the offset
is within the allocation size. This removes the explicit checks against
isNegative which were terribly error prone (including the reversed logic
that led to PR18615) and prevented us from supporting stack allocations
larger than half the address space.... Ok, so maybe the latter isn't
*common* but it's a silly restriction to have.

Also, we used to try to support a PHI node which loaded from before the
start of the allocation if any of the loaded bytes were within the
allocation. This doesn't make any sense, we have never really supported
loading or storing *before* the allocation starts. The simplified logic
just doesn't care.

We continue to allow loading past the end of the allocation in part to
support cases where there is a PHI and some loads are larger than others
and the larger ones reach past the end of the allocation. We could solve
this a different and more conservative way, but I'm still somewhat
paranoid about this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202224 91177308-0d34-0410-b5e6-96231b3b80d8
Use StringRef in raw_fd_ostream constructor

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202225 91177308-0d34-0410-b5e6-96231b3b80d8
[SROA] Compute the New{Begin,End}Offset values once for each alloca
slice being rewritten.

We had the same code scattered across most of the visits. Instead,
compute the new offsets and the slice size once when we start to visit
a particular slice, and use the member variables from then on. This
reduces quite a bit of code duplication.

No functionality changed. Refactoring inspired to make it easier to
apply the address space patch to SROA.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202227 91177308-0d34-0410-b5e6-96231b3b80d8