oota-llvm.git
8 years agoUse more foreach loops in SelectionDAG. NFC
Pete Cooper [Tue, 14 Jul 2015 23:43:29 +0000 (23:43 +0000)]
Use more foreach loops in SelectionDAG.  NFC

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

8 years agoCreate a wrapper pass for BlockFrequencyInfo.
Wei Mi [Tue, 14 Jul 2015 23:40:50 +0000 (23:40 +0000)]
Create a wrapper pass for BlockFrequencyInfo.

This is useful when we want to do block frequency analysis
conditionally (e.g. only in PGO mode) but don't want to add
one more pass dependence.

Patch by congh.
Approved by dexonsmith.
Differential Revision: http://reviews.llvm.org/D11196

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

8 years agoFix Sphinx error about duplicate label in CommandLine.rst:1560 and CoverageMappingFor...
Hans Wennborg [Tue, 14 Jul 2015 23:29:53 +0000 (23:29 +0000)]
Fix Sphinx error about duplicate label in CommandLine.rst:1560 and CoverageMappingFormat.rst

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

8 years agoWebAssembly: fix build breakage.
JF Bastien [Tue, 14 Jul 2015 23:06:07 +0000 (23:06 +0000)]
WebAssembly: fix build breakage.

Summary:
processFunctionBeforeCalleeSavedScan was renamed to determineCalleeSaves and now takes a BitVector parameter as of rL242165, reviewed in http://reviews.llvm.org/D10909

WebAssembly is still marked as experimental and therefore doesn't build by default. It does, however, grep by default! I notice that processFunctionBeforeCalleeSavedScan is still mentioned in a few comments and error messages, which I also fixed.

Reviewers: qcolombet, sunfish

Subscribers: jfb, dsanders, hfinkel, MatzeB, llvm-commits

Differential Revision: http://reviews.llvm.org/D11199

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

8 years ago[PowerPC] Support symbolic targets in patchpoints
Hal Finkel [Tue, 14 Jul 2015 22:53:11 +0000 (22:53 +0000)]
[PowerPC] Support symbolic targets in patchpoints

Follow-up r235483, with the corresponding support in PPC. We use a regular call
for symbolic targets (because they're much cheaper than indirect calls).

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

8 years agoReleaseNotes.rst: Bump version to 3.8
Hans Wennborg [Tue, 14 Jul 2015 22:49:27 +0000 (22:49 +0000)]
ReleaseNotes.rst: Bump version to 3.8

The notes for 3.7 are on the 3.7 branch.

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

8 years agoAccept lower case to handle windows error messages.
Rafael Espindola [Tue, 14 Jul 2015 22:42:21 +0000 (22:42 +0000)]
Accept lower case to handle windows error messages.

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

8 years ago[InstCombine] Generalize sub of selects optimization to all BinaryOperators
David Majnemer [Tue, 14 Jul 2015 22:39:23 +0000 (22:39 +0000)]
[InstCombine] Generalize sub of selects optimization to all BinaryOperators

This exposes further optimization opportunities if the selects are
correlated.

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

8 years agoUpdate the trunk version to 3.8.0svn.
Hans Wennborg [Tue, 14 Jul 2015 22:35:57 +0000 (22:35 +0000)]
Update the trunk version to 3.8.0svn.

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

8 years ago[LAA] Turn RuntimePointerChecking into a class, start hiding things, NFC
Adam Nemet [Tue, 14 Jul 2015 22:32:52 +0000 (22:32 +0000)]
[LAA] Turn RuntimePointerChecking into a class, start hiding things, NFC

The goal is to start hiding internal APIs.

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

8 years ago[LAA] Introduce RuntimePointerChecking::PointerInfo, NFC
Adam Nemet [Tue, 14 Jul 2015 22:32:50 +0000 (22:32 +0000)]
[LAA] Introduce RuntimePointerChecking::PointerInfo, NFC

Turn this structure-of-arrays (i.e. the various pointer attributes) into
array-of-structures.

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

8 years ago[LAA] Lift RuntimePointerCheck out of LoopAccessInfo, NFC
Adam Nemet [Tue, 14 Jul 2015 22:32:44 +0000 (22:32 +0000)]
[LAA] Lift RuntimePointerCheck out of LoopAccessInfo, NFC

I am planning to add more nested classes inside RuntimePointerCheck so
all these triple-nesting would be hard to follow.

Also rename it to RuntimePointerChecking (i.e. append 'ing').

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

8 years ago[PowerPC] Use the ABI indirect-call protocol for patchpoints
Hal Finkel [Tue, 14 Jul 2015 22:26:06 +0000 (22:26 +0000)]
[PowerPC] Use the ABI indirect-call protocol for patchpoints

We used to take the address specified as the direct target of the patchpoint
and did no TOC-pointer handling.  This, however, as not all that useful,
because MCJIT tends to create a lot of modules, and they have their own TOC
sections. Thus, to call from the generated code to other generated code, you
really need to switch TOC pointers. Make this work as expected, and under
ELFv1, tread the address as the function descriptor address so that the correct
TOC pointer can be loaded.

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

8 years agoAdd support for reading members out of thin archives.
Rafael Espindola [Tue, 14 Jul 2015 22:18:43 +0000 (22:18 +0000)]
Add support for reading members out of thin archives.

For now the Archive owns the buffers of the thin archive members.
This makes for a simple API, but all the buffers are destructed
only when the archive is destructed. This should be fine since we
close the files after mmap so we should not hit an open file
limit.

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

8 years ago[ExecutionEngine] Re-apply r241962 with fixes for ARM.
Lang Hames [Tue, 14 Jul 2015 22:11:10 +0000 (22:11 +0000)]
[ExecutionEngine] Re-apply r241962 with fixes for ARM.

Patch by Pierre-Andre Saulais. Thanks Pierre-Andre!

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

8 years agoAdd allnodes() iterator range to SelectionDAG. NFC.
Pete Cooper [Tue, 14 Jul 2015 22:10:54 +0000 (22:10 +0000)]
Add allnodes() iterator range to SelectionDAG.  NFC.

SelectionDAG already had begin/end methods for iterating over all
the nodes, but didn't define an iterator_range for us in foreach
loops.

This adds such a method and uses it in some of the eligible places
throughout the backends.

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

8 years agoMove SDNode::IROrder in to padding to save space. NFC.
Pete Cooper [Tue, 14 Jul 2015 21:54:55 +0000 (21:54 +0000)]
Move SDNode::IROrder in to padding to save space.  NFC.

There was a 32-bit padding gap between 'unsigned short NumOperands, NumValues;' and 'DebugLoc debugLoc.  Move 'unsigned IROrder' in to that gap.

This trims the size of SDNode's from 76 bytes (really 80 due to alignment) to 72 bytes.

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

8 years agoConstify parameters in SelectionDAG methods. NFC
Pete Cooper [Tue, 14 Jul 2015 21:54:52 +0000 (21:54 +0000)]
Constify parameters in SelectionDAG methods.  NFC

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

8 years agoRemove unnecessary .getNode() in SelectionDAG. NFC.
Pete Cooper [Tue, 14 Jul 2015 21:54:48 +0000 (21:54 +0000)]
Remove unnecessary .getNode() in SelectionDAG.  NFC.

The simplify_type specialisation allows us to cast directly from
SDValue to an SDNode* subclass so we don't need to pass a SDNode*
to cast<>.

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

8 years agoUse more foreach loops in SelectionDAG. NFC
Pete Cooper [Tue, 14 Jul 2015 21:54:45 +0000 (21:54 +0000)]
Use more foreach loops in SelectionDAG.  NFC

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

8 years agoMIR Serialization: Serialize the machine basic block live in registers.
Alex Lorenz [Tue, 14 Jul 2015 21:24:41 +0000 (21:24 +0000)]
MIR Serialization: Serialize the machine basic block live in registers.

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

8 years agoMIR Printer: move the function 'printReg'. NFC.
Alex Lorenz [Tue, 14 Jul 2015 21:18:25 +0000 (21:18 +0000)]
MIR Printer: move the function 'printReg'. NFC.

This commit moves the function 'printReg' towards the start of the file so that
it can be used by the conversion methods in MIRPrinter and not just the printing
methods in MIPrinter.

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

8 years agoGVN: use a static array instead of regenerating it each time. NFC.
Tim Northover [Tue, 14 Jul 2015 21:14:58 +0000 (21:14 +0000)]
GVN: use a static array instead of regenerating it each time. NFC.

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

8 years agoWebAssembly: add basic int/fp instruction codegen.
JF Bastien [Tue, 14 Jul 2015 21:13:29 +0000 (21:13 +0000)]
WebAssembly: add basic int/fp instruction codegen.

Summary: This patch has the most basic instruction codegen for 32 and 64 bit int/fp.

Reviewers: sunfish

Subscribers: llvm-commits, jfb

Differential Revision: http://reviews.llvm.org/D11193

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

8 years agoFix NDEBUG build warning
Krzysztof Parzyszek [Tue, 14 Jul 2015 21:03:24 +0000 (21:03 +0000)]
Fix NDEBUG build warning

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

8 years agoGVN: tolerate an instruction being replaced without existing in the leaderboard
Tim Northover [Tue, 14 Jul 2015 21:03:18 +0000 (21:03 +0000)]
GVN: tolerate an instruction being replaced without existing in the leaderboard

Sometimes an incidentally created instruction can duplicate a Value used
elsewhere. It then often doesn't end up in the leader table. If it's later
removed, we attempt to remove it from the leader table and segfault.

Instead we should just ignore the removal request, which won't cause any
problems. The reverse situation, where the original instruction is replaced by
the new one (which you might think could leave the leader table empty) cannot
occur, because the incidental instruction will never be found in the first
place.

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

8 years agotest-release.sh: Remove the InstallDir parameter from configure_llvmCore
Hans Wennborg [Tue, 14 Jul 2015 20:15:15 +0000 (20:15 +0000)]
test-release.sh: Remove the InstallDir parameter from configure_llvmCore

After r242187, it's never set.

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

8 years agoFix Windows build: replace __func__ with LLVM_FUNCTION_NAME
Krzysztof Parzyszek [Tue, 14 Jul 2015 20:11:28 +0000 (20:11 +0000)]
Fix Windows build: replace __func__ with LLVM_FUNCTION_NAME

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

8 years ago[MMX] Use the appropriate instructions for GR64 <-> VR64 copies.
Bruno Cardoso Lopes [Tue, 14 Jul 2015 20:09:34 +0000 (20:09 +0000)]
[MMX] Use the appropriate instructions for GR64 <-> VR64 copies.

MOVSDto64rr and MOV64toSDrr are defined to convert between FR64 (%xmm)
<-> GR64 registers, not VR64 (%mm) <-> GR64. This is wrong.

I found this by inspection and could not find a suitable testcase for it
since (1) we don't handle MMX bitcasts in Peephole optimizer as to
generate COPYs that (2) could be expanded back to the appropriate x86
instruction in ExpandPostRA.

Switch to use the appropriate instructions: MMX_MOVD64from64rr and
MMX_MOVD64to64rr here.

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

8 years ago[PowerPC] Fix the PPCInstrInfo::getInstrLatency implementation
Hal Finkel [Tue, 14 Jul 2015 20:02:02 +0000 (20:02 +0000)]
[PowerPC] Fix the PPCInstrInfo::getInstrLatency implementation

PowerPC uses itineraries to describe processor pipelines (and dispatch-group
restrictions for P7/P8 cores). Unfortunately, the target-independent
implementation of TII.getInstrLatency calls ItinData->getStageLatency, and that
looks for the largest cycle count in the pipeline for any given instruction.
This, however, yields the wrong answer for the PPC itineraries, because we
don't encode the full pipeline. Because the functional units are fully
pipelined, we only model the initial stages (there are no relevant hazards in
the later stages to model), and so the technique employed by getStageLatency
does not really work. Instead, we should take the maximum output operand
latency, and that's what PPCInstrInfo::getInstrLatency now does.

This caused some test-case churn, including two unfortunate side effects.
First, the new arrangement of copies we get from function parameters now
sometimes blocks VSX FMA mutation (a FIXME has been added to the code and the
test cases), and we have one significant test-suite regression:

SingleSource/Benchmarks/BenchmarkGame/spectral-norm
56.4185% +/- 18.9398%

In this benchmark we have a loop with a vectorized FP divide, and it with the
new scheduling both divides end up in the same dispatch group (which in this
case seems to cause a problem, although why is not exactly clear). The grouping
structure is hard to predict from the bottom of the loop, and there may not be
much we can do to fix this.

Very few other test-suite performance effects were really significant, but
almost all weakly favor this change. However, in light of the issues
highlighted above, I've left the old behavior available via a
command-line flag.

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

8 years agoFix several issues with the test-release.sh script
Dan Liew [Tue, 14 Jul 2015 19:46:19 +0000 (19:46 +0000)]
Fix several issues with the test-release.sh script

* Use the default install prefix (/usr/local) and use DESTDIR instead to
  set a temporary install location for tarballing. This is the correct
  way to package binary releases (otherwise the temporary install path
  ends up in files in the binary release).
* Remove ``-disable-clang`` option. It did not work correctly
  (tarballing assumed phase 3 was run) and when doing a release
  we should always be doing a three-phased build and test.

Note: Technically we should only be using DESTDIR for the third phase
and use --prefix for the first and second phase because we run the built
clang from phase 1 and 2 (and in general an application's behaviour
may depend on the install prefix). However in the case of clang it
seems to not care what the install prefix was so to simplify the script
we use DESTDIR for all three stages.

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

8 years ago[Hexagon] Generate instructions for operations on predicate registers
Krzysztof Parzyszek [Tue, 14 Jul 2015 19:30:21 +0000 (19:30 +0000)]
[Hexagon] Generate instructions for operations on predicate registers

Convert logical operations on general-purpose registers to the correspon-
ding operations on predicate registers.

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

8 years ago[CodeGen] Force emission of personality directive if explicitly specified
Keno Fischer [Tue, 14 Jul 2015 19:22:51 +0000 (19:22 +0000)]
[CodeGen] Force emission of personality directive if explicitly specified

Summary:
Before this change, personality directives were not emitted
if there was no invoke left in the function (of course until
recently this also meant that we couldn't know what
the personality actually was). This patch forces personality directives
to still be emitted, unless it is known to be a noop in the absence of
invokes, or the user explicitly specified `nounwind` (and not
`uwtable`) on the function.

Reviewers: majnemer, rnk

Subscribers: rnk, llvm-commits

Differential Revision: http://reviews.llvm.org/D10884

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

8 years agoAdd support for on-disk hash table lookup with a known hash, for situations where...
Richard Smith [Tue, 14 Jul 2015 18:40:59 +0000 (18:40 +0000)]
Add support for on-disk hash table lookup with a known hash, for situations where the same key will be looked up in multiple tables.

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

8 years agoTeach config.guess that MSYS exists.
Yaron Keren [Tue, 14 Jul 2015 18:33:55 +0000 (18:33 +0000)]
Teach config.guess that MSYS exists.

We might not want to upgrade config.guess to the current
version due to the license change from GPL2 to GPL3.

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

8 years agoAMDGPU: Avoid using 64-bit shift for i64 (shl x, 32)
Matt Arsenault [Tue, 14 Jul 2015 18:20:33 +0000 (18:20 +0000)]
AMDGPU: Avoid using 64-bit shift for i64 (shl x, 32)

This can be done only with moves which theoretically
will optimize better later.

Although this transform increases the instruction count,
it should be code size / cycle count neutral in the worst
VALU case. It also seems to slightly improve a couple
of testcases due to other DAG combines this exposes.

This is probably slightly worse for the SALU case, so
it might be better to handle this during moveToVALU,
although then you lose some simplifications like
the load width reducing in the simple testcase.

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

8 years agoAMDGPU/SI: Fix read2 merging into a super register.
Matt Arsenault [Tue, 14 Jul 2015 17:57:36 +0000 (17:57 +0000)]
AMDGPU/SI: Fix read2 merging into a super register.

If the read2 produced was supposed to be writing into a
super register, it would use the wrong subregister indices.
Fix this by inserting copies, so we only ever write to a vreg_64.
Run the register coalescer again to clean this up, although this
isn't ideal and often does result in an extra move.

Also remove the assert that offset1 > offset0.

There isn't a real reason to not allow this other than a minor
convenience in the compiler, and it doesn't seem worth the effort
of avoiding it.

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

8 years agoMachineRegisterInfo: Remove UsedPhysReg infrastructure
Matthias Braun [Tue, 14 Jul 2015 17:52:07 +0000 (17:52 +0000)]
MachineRegisterInfo: Remove UsedPhysReg infrastructure

We have a detailed def/use lists for every physical register in
MachineRegisterInfo anyway, so there is little use in maintaining an
additional bitset of which ones are used.

Removing it frees us from extra book keeping. This simplifies
VirtRegMap.

Differential Revision: http://reviews.llvm.org/D10911

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

8 years agoAvoid MSVC-incompatible use of init list.
David Blaikie [Tue, 14 Jul 2015 17:40:53 +0000 (17:40 +0000)]
Avoid MSVC-incompatible use of init list.

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

8 years agoRAGreedy: Keep track of allocated PhysRegs internally
Matthias Braun [Tue, 14 Jul 2015 17:38:17 +0000 (17:38 +0000)]
RAGreedy: Keep track of allocated PhysRegs internally

Do not use MachineRegisterInfo::setPhysRegUsed()/isPhysRegUsed()
anymore. This bitset changes function-global state and is set by the
VirtRegRewriter anyway.
Simply use a bitvector private to RAGreedy.

Differential Revision: http://reviews.llvm.org/D10910

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

8 years agoAdd missing builtins to the PPC back end for ABI compliance (vol. 4)
Nemanja Ivanovic [Tue, 14 Jul 2015 17:25:20 +0000 (17:25 +0000)]
Add missing builtins to the PPC back end for ABI compliance (vol. 4)

This patch corresponds to review:
http://reviews.llvm.org/D11183

Back end portion of the fourth round of additions to altivec.h.

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

8 years agoARM: add at least one real test for r242123.
Tim Northover [Tue, 14 Jul 2015 17:23:55 +0000 (17:23 +0000)]
ARM: add at least one real test for r242123.

The ones committed were orthogonal to the change and would have passed before
that revision. What it *did* do was prevent an assertion failure when
generating object files.

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

8 years agoPrologEpilogInserter: Rewrite API to determine callee save regsiters.
Matthias Braun [Tue, 14 Jul 2015 17:17:13 +0000 (17:17 +0000)]
PrologEpilogInserter: Rewrite API to determine callee save regsiters.

This changes TargetFrameLowering::processFunctionBeforeCalleeSavedScan():

- Rename the function to determineCalleeSaves()
- Pass a bitset of callee saved registers by reference, thus avoiding
  the function-global PhysRegUsed bitset in MachineRegisterInfo.
- Without PhysRegUsed the implementation is fine tuned to not save
  physcial registers which are only read but never modified.

Related to rdar://21539507

Differential Revision: http://reviews.llvm.org/D10909

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

8 years agoAArch64: add rev64 alias for 64-bit rev instruction.
Tim Northover [Tue, 14 Jul 2015 17:07:29 +0000 (17:07 +0000)]
AArch64: add rev64 alias for 64-bit rev instruction.

It could be useful to assembly programmers and makes the permitted variants a
little more uniform.

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

8 years ago[Hexagon] Generate "extract" instructions more aggressively
Krzysztof Parzyszek [Tue, 14 Jul 2015 17:07:24 +0000 (17:07 +0000)]
[Hexagon] Generate "extract" instructions more aggressively

Generate extract instructions (via intrinsics) before the DAG combiner
folds shifts into unrecognizable forms.

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

8 years agollvm-ar: Don't try to extract from thin archives.
Rafael Espindola [Tue, 14 Jul 2015 16:55:13 +0000 (16:55 +0000)]
llvm-ar: Don't try to extract from thin archives.

This matches the gnu ar behavior.

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

8 years agoARMAsmParser: Take MCInst param by const-ref
Hans Wennborg [Tue, 14 Jul 2015 16:39:01 +0000 (16:39 +0000)]
ARMAsmParser: Take MCInst param by const-ref

(Broken out from http://reviews.llvm.org/D11167)

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

8 years agoAdd default value for Args parameter of IRBuilder::CreateCall
David Blaikie [Tue, 14 Jul 2015 16:38:30 +0000 (16:38 +0000)]
Add default value for Args parameter of IRBuilder::CreateCall

Convenient for calls to zero-argument functions.

Patch by servuswiegehtz at yahoo.de

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

8 years agoSleep for 2.1 seconds to see if that makes the test stable on windows.
Rafael Espindola [Tue, 14 Jul 2015 16:34:23 +0000 (16:34 +0000)]
Sleep for 2.1 seconds to see if that makes the test stable on windows.

Might fix pr24106.

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

8 years agoAllocate the IntervalMap in ELF.h on the heap to work around MSVC alignment bug ...
Hans Wennborg [Tue, 14 Jul 2015 16:27:16 +0000 (16:27 +0000)]
Allocate the IntervalMap in ELF.h on the heap to work around MSVC alignment bug (PR24113)

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

8 years agollvm-ar: print an error when the requested member is not found.
Rafael Espindola [Tue, 14 Jul 2015 16:02:40 +0000 (16:02 +0000)]
llvm-ar: print an error when the requested member is not found.

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

8 years agoUse a range loop. NFC.
Rafael Espindola [Tue, 14 Jul 2015 15:22:42 +0000 (15:22 +0000)]
Use a range loop. NFC.

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

8 years agoRevert "Fix `llvm-config` to emit the linker flag for the combined shared object...
JF Bastien [Tue, 14 Jul 2015 15:10:34 +0000 (15:10 +0000)]
Revert "Fix `llvm-config` to emit the linker flag for the combined shared object built by autoconfig/make instead of the individual components."

This reverts commit 01446706b4c0a86bb64768f307079cab5c514aa3.

Causes breakage, seems to be related to 'svn' in the file's name:

  CC=gcc CXX=g++ \
  ../llvm/configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --enable-shared \
    --enable-libffi \
    --enable-targets=all \
    --disable-assertions \
    --with-python=/usr/bin/python2 \
    --enable-optimized

  make REQUIRES_RTTI=1 ENABLE_PIC=1

results:
llvm[2]: Linking Release unit test Support (without symbols)
llvm[2]: ======= Finished Linking Release Unit test Support (without symbols)
make[3]: Entering directory '/build/llvm-svn/src/build/bindings/ocaml/llvm'
make[3]: *** No rule to make target '/build/llvm-
svn/src/build/Release/lib/ocaml/libLLVM-3.7.0svn.so', needed by 'build-
deplibs'.  Stop.
make[3]: *** Waiting for unfinished jobs....
llvm[3]: Compiling llvm_ocaml.c for Release build
make[3]: Leaving directory '/build/llvm-svn/src/build/bindings/ocaml/llvm'
/build/llvm-svn/src/llvm/Makefile.rules:880: recipe for target 'all' failed
/build/llvm-svn/src/llvm/Makefile.rules:965: recipe for target 'all' failed

Differential Revision: http://reviews.llvm.org/D10716

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

8 years agoRename a test. NFC.
Rafael Espindola [Tue, 14 Jul 2015 15:06:18 +0000 (15:06 +0000)]
Rename a test. NFC.

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

8 years agoCaused regressions: compile Release+Asserts failed on clang-native-arm-cortex-a9
Alexandros Lamprineas [Tue, 14 Jul 2015 14:34:06 +0000 (14:34 +0000)]
Caused regressions: compile Release+Asserts failed on clang-native-arm-cortex-a9
Revert "-Added API for retrieving the default FPU of a CPU from TargetParser."

This reverts commit 01199ab0c6ff2d5c4f6b2c05a95ec011e41c4669.

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

8 years agoAMDGPU/SI: Add support for shrinking v_cndmask_b32_e32 instructions
Tom Stellard [Tue, 14 Jul 2015 14:15:03 +0000 (14:15 +0000)]
AMDGPU/SI: Add support for shrinking v_cndmask_b32_e32 instructions

Reviewers: arsenm

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11061

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

8 years agoSilencing two MSVC warnings; 'argument' : truncation from 'unsigned int' to 'int16_t...
Aaron Ballman [Tue, 14 Jul 2015 14:14:00 +0000 (14:14 +0000)]
Silencing two MSVC warnings; 'argument' : truncation from 'unsigned int' to 'int16_t' and truncation of constant value. NFC intended.

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

8 years ago-Added API for retrieving the default FPU of a CPU from TargetParser.
Alexandros Lamprineas [Tue, 14 Jul 2015 13:20:48 +0000 (13:20 +0000)]
-Added API for retrieving the default FPU of a CPU from TargetParser.
-Implemented as a table lookup.

Change-Id: Ibf7217f6bd2769e9c06835a5aede3d072dee6757
Phabricator: http://reviews.llvm.org/D11100

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

8 years ago[mips] Fix li/la differences between IAS and GAS.
Daniel Sanders [Tue, 14 Jul 2015 12:24:22 +0000 (12:24 +0000)]
[mips] Fix li/la differences between IAS and GAS.

Summary:
- Signed 16-bit should have priority over unsigned.
- For la, unsigned 16-bit must use ori+addu rather than directly use ori.
- Correct tests on 32-bit immediates with 64-bit predicates by
  sign-extending the immediate beforehand. For example, isInt<16>(0xffff8000)
  should be true and use addiu.

Also split li/la testing into separate files due to their size.

Reviewers: vkalintiris

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D10967

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

8 years ago[PM/AA] Reformat GlobalsModRef so that subsequent patches I make here
Chandler Carruth [Tue, 14 Jul 2015 08:42:39 +0000 (08:42 +0000)]
[PM/AA] Reformat GlobalsModRef so that subsequent patches I make here
don't continually introduce formatting deltas. NFC

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

8 years agoFix comment typo
Petr Pavlu [Tue, 14 Jul 2015 08:00:34 +0000 (08:00 +0000)]
Fix comment typo

Test commit access.

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

8 years ago[SROA] Don't de-atomic volatile loads and stores
David Majnemer [Tue, 14 Jul 2015 06:19:58 +0000 (06:19 +0000)]
[SROA] Don't de-atomic volatile loads and stores

Volatile loads and stores are made visible in global state regardless of
what memory is involved.  It is not correct to disregard the ordering
and synchronization scope because it is possible to synchronize with
memory operations performed by hardware.

This partially addresses PR23737.

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

8 years agoGenerate correct asm info for mingw and cygwin ARM targets.
Yaron Keren [Tue, 14 Jul 2015 05:51:05 +0000 (05:51 +0000)]
Generate correct asm info for mingw and cygwin ARM targets.

http://reviews.llvm.org/D11075

Patch by Martell Malone
Reviewed by Reid Kleckner

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

8 years ago[CMake] Unbreak add_llvm_external_project when external projects are specified.
NAKAMURA Takumi [Tue, 14 Jul 2015 05:12:53 +0000 (05:12 +0000)]
[CMake] Unbreak add_llvm_external_project when external projects are specified.

LLVM_EXTERNAL_*_SOURCE_DIR is reset as PATH with set(CACHE PATH).
Then the CACHE PATH variable, LLVM_EXTERNAL_*_SOURCE_DIR, is normalized as
${CMAKE_SOURCE_DIR}/${path_var} if ${path_var} is relative.

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

8 years agoPrune trailing whitespaces and CRs.
NAKAMURA Takumi [Tue, 14 Jul 2015 04:03:49 +0000 (04:03 +0000)]
Prune trailing whitespaces and CRs.

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

8 years agoGive an explicit triple to llvm/test/CodeGen/X86/pr13577.ll.
NAKAMURA Takumi [Tue, 14 Jul 2015 03:07:06 +0000 (03:07 +0000)]
Give an explicit triple to llvm/test/CodeGen/X86/pr13577.ll.

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

8 years agoRevert "LegalizeDAG: Fix and improve FCOPYSIGN/FABS legalization"
Matthias Braun [Tue, 14 Jul 2015 02:09:57 +0000 (02:09 +0000)]
Revert "LegalizeDAG: Fix and improve FCOPYSIGN/FABS legalization"

Accidental commit, needs review first.

This reverts commit r242107.

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

8 years agoLegalizeDAG: Fix and improve FCOPYSIGN/FABS legalization
Matthias Braun [Tue, 14 Jul 2015 02:08:26 +0000 (02:08 +0000)]
LegalizeDAG: Fix and improve FCOPYSIGN/FABS legalization

- Factor out code to query and modify the sign bit of a floatingpoint
  value as an integer. This also works if none of the targets integer
  types is big enough to hold all bits of the floatingpoint value.

- Legalize FABS(x) as FCOPYSIGN(x, 0.0) if FCOPYSIGN is available,
  otherwise perform bit manipulation on the sign bit. The previous code
  used "x >u 0 ? x : -x" which is incorrect for x being -0.0! It also
  takes 34 instructions on ARM Cortex-M4. With this patch we only
  require 5:
    vldr d0, LCPI0_0
    vmov r2, r3, d0
    lsrs r2, r3, #31
    bfi r1, r2, #31, #1
    bx lr
  (This could be further improved if the compiler would recognize that
   r2, r3 is zero).

- Only lower FCOPYSIGN(x, y) = sign(x) ? -FABS(x) : FABS(x) if FABS is
  available otherwise perform bit manipulation on the sign bit.

- Perform the sign(x) test by masking out the sign bit and comparing
  with 0 rather than shifting the sign bit to the highest position and
  testing for "<s 0". For x86 copysignl (on 80bit values) this gets us:
    testl $32768, %eax
  rather than:
    shlq $48, %rax
    sets %al
    testb %al, %al

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

8 years agoX86: Check output of x86 copysignl testcase.
Matthias Braun [Tue, 14 Jul 2015 02:08:23 +0000 (02:08 +0000)]
X86: Check output of x86 copysignl testcase.

This makes the changes in an upcoming patch visible.

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

8 years agoAdd capability to get and set the personalitty function from the C API
Andrew Wilkins [Tue, 14 Jul 2015 01:23:06 +0000 (01:23 +0000)]
Add capability to get and set the personalitty function from the C API

Summary:
The capability was lost with D10429 where the personality function was set at function level rather than landing pad level. Now there is no way to get/set the personality function from the C API. That is a problem.

Note that the whole thing could be avoided by improving the C API testing, as started by D10725

Reviewers: chandlerc, bogner, majnemer, andrew.w.kaylor, rafael, rnk, axw

Subscribers: rafael, llvm-commits

Differential Revision: http://reviews.llvm.org/D10946

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

8 years ago[CMake] Forgot to quote the first part of STREQUAL.
Chris Bieneman [Tue, 14 Jul 2015 01:19:07 +0000 (01:19 +0000)]
[CMake] Forgot to quote the first part of STREQUAL.

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

8 years ago[CMake] We shouldn't be storing values in the cache unless they actually need CMake...
Chris Bieneman [Tue, 14 Jul 2015 01:17:43 +0000 (01:17 +0000)]
[CMake] We shouldn't be storing values in the cache unless they actually need CMake cache behavior.

add_llvm_external_project puts LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR into the cache even if it is just the in-tree default path. This causes all sorts of oddness, and makes it so that I can't change the behavior of this variable.

This patch never puts LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR into the cache. It will only end up in the cache if it is specified on the command line, which is the correct behavior.

There is also a temporary change to remove non-default values from the cache if they are already present. This should have the impact of cleaning out unncecissary values from the caches on the buildbots and people's local build directories. This part of the change is marked with a TODO and can be removed in a few days.

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

8 years agoAdd a herper function. NFC.
Rafael Espindola [Tue, 14 Jul 2015 01:06:16 +0000 (01:06 +0000)]
Add a herper function. NFC.

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

8 years agoMIR Serialization: Serialize the variable sized stack objects.
Alex Lorenz [Tue, 14 Jul 2015 00:26:26 +0000 (00:26 +0000)]
MIR Serialization: Serialize the variable sized stack objects.

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

8 years agoUpdate enforceKnownAlignment after the isWeakForLinker semantic change
Reid Kleckner [Tue, 14 Jul 2015 00:11:08 +0000 (00:11 +0000)]
Update enforceKnownAlignment after the isWeakForLinker semantic change

Previously we would refrain from attempting to increase the linkage of
available_externally globals because they were considered weak for the
linker. Now they are treated more like a declaration instead of a weak
definition.

This was causing SSE alignment faults in Chromuim, when some code
assumed it could increase the alignment of a dllimported global that it
didn't control.  http://crbug.com/509256

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

8 years agoMIR Serialization: Serialize the sub register indices.
Alex Lorenz [Mon, 13 Jul 2015 23:24:34 +0000 (23:24 +0000)]
MIR Serialization: Serialize the sub register indices.

This commit serializes the sub register indices from the register machine
operands.

Reviewers: Duncan P. N. Exon Smith

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

8 years agoAdd missing file.
Rafael Espindola [Mon, 13 Jul 2015 23:14:26 +0000 (23:14 +0000)]
Add missing file.

Sorry about that.

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

8 years agoFix reading archive members with / in the name.
Rafael Espindola [Mon, 13 Jul 2015 23:07:05 +0000 (23:07 +0000)]
Fix reading archive members with / in the name.

This is important for thin archives.

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

8 years ago[PPC64LE] More improvements to VSX swap optimization
Bill Schmidt [Mon, 13 Jul 2015 22:58:19 +0000 (22:58 +0000)]
[PPC64LE] More improvements to VSX swap optimization

This patch allows VSX swap optimization to succeed more frequently.
Specifically, it is concerned with common code sequences that occur
when copying a scalar floating-point value to a vector register.  This
patch currently handles cases where the floating-point value is
already in a register, but does not yet handle loads (such as via an
LXSDX scalar floating-point VSX load).  That will be dealt with later.

A typical case is when a scalar value comes in as a floating-point
parameter.  The value is copied into a virtual VSFRC register, and
then a sequence of SUBREG_TO_REG and/or COPY operations will convert
it to a full vector register of the class required by the context.  If
this vector register is then used as part of a lane-permuted
computation, the original scalar value will be in the wrong lane.  We
can fix this by adding a swap operation following any widening
SUBREG_TO_REG operation.  Additional COPY operations may be needed
around the swap operation in order to keep register assignment happy,
but these are pro forma operations that will be removed by coalescing.

If a scalar value is otherwise directly referenced in a computation
(such as by one of the many XS* vector-scalar operations), we
currently disable swap optimization.  These operations are
lane-sensitive by definition.  A MentionsPartialVR flag is added for
use in each swap table entry that mentions a scalar floating-point
register without having special handling defined.

A common idiom for PPC64LE is to convert a double-precision scalar to
a vector by performing a splat operation.  This ensures that the value
can be referenced as V[0], as it would be for big endian, whereas just
converting the scalar to a vector with a SUBREG_TO_REG operation
leaves this value only in V[1].  A doubleword splat operation is one
form of an XXPERMDI instruction, which takes one doubleword from a
first operand and another doubleword from a second operand, with a
two-bit selector operand indicating which doublewords are chosen.  In
the general case, an XXPERMDI can be permitted in a lane-swapped
region provided that it is properly transformed to select the
corresponding swapped values.  This transformation is to reverse the
order of the two input operands, and to reverse and complement the
bits of the selector operand (derivation left as an exercise to the
reader ;).

A new test case that exercises the scalar-to-vector and generalized
XXPERMDI transformations is added as CodeGen/PowerPC/swaps-le-5.ll.
The patch also requires a change to CodeGen/PowerPC/swaps-le-3.ll to
use CHECK-DAG instead of CHECK for two independent instructions that
now appear in reverse order.

There are two small unrelated changes that are added with this patch.
First, the XXSLDWI instruction was incorrectly omitted from the list
of lane-sensitive instructions; this is now fixed.  Second, I observed
that the same webs were being rejected over and over again for
different reasons.  Since it's sufficient to reject a web only once, I
added a check for this to speed up the compilation time slightly.

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

8 years agoUse std::make_tuple to reduce code duplication.
Rafael Espindola [Mon, 13 Jul 2015 22:01:02 +0000 (22:01 +0000)]
Use std::make_tuple to reduce code duplication.

Thanks to David Blaikie for the suggestion.

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

8 years agoRemove unnecessary lines from the test in r242068.
Pete Cooper [Mon, 13 Jul 2015 21:50:35 +0000 (21:50 +0000)]
Remove unnecessary lines from the test in r242068.

This test case was breaking the hexagon elf bot.  The failing lines
were actually unnecessary as checking that the store still reads the
correct value demonstrates that everything is working fine now.

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

8 years agoReduce memory usage of ComputeEditDistance() by (almost) 50%
Nico Weber [Mon, 13 Jul 2015 21:33:21 +0000 (21:33 +0000)]
Reduce memory usage of ComputeEditDistance() by (almost) 50%

ComputeEditDistance() currently keeps two rows of the edit distance matrix in
memory.  That's unnecessary, one row plus one additional element are sufficient.
With this change, strings up to 64 chars can be processed without going to the
heap, compared to 32 chars previously.  (But the main motivation is that the
code gets a bit simpler.)

No intended behavior change.

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

8 years agoLoop idiom recognizer was replacing too many uses of popcount.
Pete Cooper [Mon, 13 Jul 2015 21:25:33 +0000 (21:25 +0000)]
Loop idiom recognizer was replacing too many uses of popcount.

When spotting that a loop can use ctpop, we were incorrectly replacing all uses of a value with a value derived from ctpop.

The bug here was exposed because we were replacing a use prior to the ctpop with the ctpop value and so we have a use before def, i.e., we changed

 %tobool.5 = icmp ne i32 %num, 0
 store i1 %tobool.5, i1* %ptr
 br i1 %tobool.5, label %for.body.lr.ph, label %for.end

to

 store i1 %1, i1* %ptr
 %0 = call i32 @llvm.ctpop.i32(i32 %num)
 %1 = icmp ne i32 %0, 0
 br i1 %1, label %for.body.lr.ph, label %for.end

Even if we inserted the ctpop so that it dominates the store here, that would still be incorrect.  The store doesn’t want the result of ctpop.

The fix is very simple, and involves replacing only the branch condition with the ctpop instead of all uses.

Reviewed by Hal Finkel.

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

8 years ago[WinEH] Emit the LSDA even if no lpads remain but outlining occurred
Reid Kleckner [Mon, 13 Jul 2015 20:41:46 +0000 (20:41 +0000)]
[WinEH] Emit the LSDA even if no lpads remain but outlining occurred

The outlined funclets call intrinsics which reference labels from the
LSDA. This situation can easily arise in small functions with a single
cleanup at -O0, where Clang marks a definition as nounwind, and then
WinEHPrepare "discovers" that the landingpad is dead by accident and
deletes it.

We now need to ask the LLVM IR Function for it's personality directly,
rather than going through MachineModuleInfo.

Fixes PR23892.

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

8 years ago[Hexagon] Move BitTracker into the llvm namespace and remove redundant qualifications
Benjamin Kramer [Mon, 13 Jul 2015 20:38:16 +0000 (20:38 +0000)]
[Hexagon] Move BitTracker into the llvm namespace and remove redundant qualifications

No functional change intended.

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

8 years agoAdd support deterministic output in llvm-ar and make it the default.
Rafael Espindola [Mon, 13 Jul 2015 20:38:09 +0000 (20:38 +0000)]
Add support deterministic output in llvm-ar and make it the default.

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

8 years agoRevert "[CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registrati...
Chris Bieneman [Mon, 13 Jul 2015 20:30:58 +0000 (20:30 +0000)]
Revert "[CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working."

Reverting r242059 because it broke some bots. I'm attempting to reproduce the failures now.

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

8 years ago[CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that...
Chris Bieneman [Mon, 13 Jul 2015 20:23:15 +0000 (20:23 +0000)]
[CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working.

Summary:
This change re-lands r241621, with an additional fix that was required to allow tool sources to live outside the llvm checkout. It also no longer renames LLVM_EXTERNAL_*_SOURCE_DIR. This change was reverted in r241663, because it renamed several variables of the format LLVM_EXTERNAL_*_* to LLVM_TOOL_*_*.

Original Summary:
The tools CMakeLists file already had implicit tool registration, but there were a few things off about it that needed to be altered to make it work. This change addresses all that. The changes in this patch are:

* factored out canonicalizing tool names from paths to CMake variables * removed the LLVM_IMPLICIT_PROJECT_IGNORE mechanism in favor of LLVM_EXTERNAL_${nameUPPER}_BUILD which I renamed to LLVM_TOOL_${nameUPPER}_BUILD because it applies to internal and external tools
* removed ignore_llvm_tool_subdirectory() in favor of just setting LLVM_TOOL_${nameUPPER}_BUILD to Off
* Added create_llvm_tool_options() to resolve a bug in add_llvm_external_project() - the old LLVM_EXTERNAL_${nameUPPER}_BUILD would not work on a clean CMake directory because the option could be created after it was set in code.
* Removed all but the minimum required calls to add_llvm_external_project from tools/CMakeLists.txt

Differential Revision: http://reviews.llvm.org/D10665

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

8 years ago[CMake] Add missing DebugInfo libraries to llvm-shlib
Keno Fischer [Mon, 13 Jul 2015 19:41:51 +0000 (19:41 +0000)]
[CMake] Add missing DebugInfo libraries to llvm-shlib

Reviewers: beanz

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11128

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

8 years agoAMDGPU: Minor cleanups to always inline pass
Matt Arsenault [Mon, 13 Jul 2015 19:08:36 +0000 (19:08 +0000)]
AMDGPU: Minor cleanups to always inline pass

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

8 years ago[MC] Correctly escape .safeseh's symbol
David Majnemer [Mon, 13 Jul 2015 18:51:15 +0000 (18:51 +0000)]
[MC] Correctly escape .safeseh's symbol

This fixes PR24107.

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

8 years agoEnable partial and runtime loop unrolling for NVPTX.
Mark Heffernan [Mon, 13 Jul 2015 18:33:21 +0000 (18:33 +0000)]
Enable partial and runtime loop unrolling for NVPTX.

Enable partial and runtime loop unrolling for NVPTX backend via
TTI::UnrollingPreferences with a small threshold. This partially unrolls
small loops which are often unrolled by the PTX to SASS compiler
and unrolling earlier can be beneficial.

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

8 years agoEnable runtime unrolling with unroll pragma metadata
Mark Heffernan [Mon, 13 Jul 2015 18:26:27 +0000 (18:26 +0000)]
Enable runtime unrolling with unroll pragma metadata

Enable runtime unrolling for loops with unroll count metadata ("#pragma unroll N")
and a runtime trip count. Also, do not unroll loops with unroll full metadata if the
loop has a runtime loop count. Previously, such loops would be unrolled with a
very large threshold (pragma-unroll-threshold) if runtime unrolled happened to be
enabled resulting in a very large (and likely unwise) unroll factor.

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

8 years agoService the doxygen comments in DwarfUnit and DwarfDebug.
Adrian Prantl [Mon, 13 Jul 2015 18:25:29 +0000 (18:25 +0000)]
Service the doxygen comments in DwarfUnit and DwarfDebug.

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

8 years agoMIR Serialization: Serialize the fixed stack objects.
Alex Lorenz [Mon, 13 Jul 2015 18:07:26 +0000 (18:07 +0000)]
MIR Serialization: Serialize the fixed stack objects.

This commit serializes the fixed stack objects, including fixed spill slots.
The fixed stack objects are serialized using a YAML sequence of YAML inline
mappings. Each mapping has the object's ID, type, size, offset, and alignment.
The objects that aren't spill slots also serialize the isImmutable and isAliased
flags.

The fixed stack objects are a part of the machine function's YAML mapping.

Reviewers: Duncan P. N. Exon Smith

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

8 years ago[WinEH] Strip the \01 character from the __CxxFrameHandler3 thunk name
Reid Kleckner [Mon, 13 Jul 2015 17:55:14 +0000 (17:55 +0000)]
[WinEH] Strip the \01 character from the __CxxFrameHandler3 thunk name

Add another C++ 32-bit EH table test.

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

8 years agoRemove macro guards for extern template instantiations.
Benjamin Kramer [Mon, 13 Jul 2015 17:21:31 +0000 (17:21 +0000)]
Remove macro guards for extern template instantiations.

This is a C++11 feature that both GCC and MSVC have supported as ane extension
long before C++11 was approved.

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

8 years agoAvoid using Loop::getSubLoopsVector.
Benjamin Kramer [Mon, 13 Jul 2015 17:21:14 +0000 (17:21 +0000)]
Avoid using Loop::getSubLoopsVector.

Passes should never modify it, just use the const version. While there
reduce copying in LoopInterchange. No functional change intended.

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

8 years agoFix handling of the 'n' asm constraint with invalid operands.
James Y Knight [Mon, 13 Jul 2015 16:36:22 +0000 (16:36 +0000)]
Fix handling of the 'n' asm constraint with invalid operands.

It had accidently accepted a symbol+offset value (and emitted
incorrect code for it, keeping only the offset part) instead of
properly reporting the constraint as invalid.

Differential Revision: http://reviews.llvm.org/D11039

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

8 years agoAMDGPU/SI: Select mad patterns to v_mac_f32
Tom Stellard [Mon, 13 Jul 2015 15:47:57 +0000 (15:47 +0000)]
AMDGPU/SI: Select mad patterns to v_mac_f32

The two-address instruction pass will convert these back to v_mad_f32
if necessary.

Differential Revision: http://reviews.llvm.org/D11060

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