oota-llvm.git
8 years agoUse std::bitset for SubtargetFeatures
Michael Kuperstein [Wed, 13 May 2015 08:27:08 +0000 (08:27 +0000)]
Use std::bitset for SubtargetFeatures

Previously, subtarget features were a bitfield with the underlying type being uint64_t.
Since several targets (X86 and ARM, in particular) have hit or were very close to hitting this bound, switching the features to use a bitset.
No functional change.

The first two times this was committed (r229831, r233055), it caused several buildbot failures.
At least some of the ARM and MIPS ones were due to gcc/binutils issues, and should now be fixed.

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

8 years agoAVX-512: fixed a bug in encoding of VPSRAQ instrcution,
Elena Demikhovsky [Wed, 13 May 2015 07:35:05 +0000 (07:35 +0000)]
AVX-512: fixed a bug in encoding of VPSRAQ instrcution,
added a bunch of encoding tests.

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

8 years agoUse ArrayRef::slice instead of manually constructing an ArrayRef from ArrayRef iterat...
Craig Topper [Wed, 13 May 2015 06:57:51 +0000 (06:57 +0000)]
Use ArrayRef::slice instead of manually constructing an ArrayRef from ArrayRef iterators. NFC

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

8 years agoConstify arguments to methods in LICM. NFC
Pete Cooper [Wed, 13 May 2015 01:12:18 +0000 (01:12 +0000)]
Constify arguments to methods in LICM.  NFC

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

8 years agoChange LoadAndStorePromoter to take ArrayRef instead of SmallVectorImpl&.
Pete Cooper [Wed, 13 May 2015 01:12:16 +0000 (01:12 +0000)]
Change LoadAndStorePromoter to take ArrayRef instead of SmallVectorImpl&.

The array passed to LoadAndStorePromoter's constructor was a constant reference to a SmallVectorImpl, which is just the same as passing an ArrayRef.

Also, the data in the array can be 'const Instruction*' instead of 'Instruction*'.  Its not possible to convert a SmallVectorImpl<T*> to SmallVectorImpl<const T*>, but ArrayRef does provide such a method.

Currently this added calls to makeArrayRef which should be a nop, but i'm going to kick off a discussion about improving ArrayRef to not need these.

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

8 years agoConstify arguments in AliasSetTracker methods. NFC
Pete Cooper [Wed, 13 May 2015 01:12:12 +0000 (01:12 +0000)]
Constify arguments in AliasSetTracker methods.  NFC

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

8 years agoChange a loop in LoopInfo to foreach. NFC
Pete Cooper [Wed, 13 May 2015 01:12:09 +0000 (01:12 +0000)]
Change a loop in LoopInfo to foreach.  NFC

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

8 years agoConstify arguments to methods in LoopInfo. NFC
Pete Cooper [Wed, 13 May 2015 01:12:06 +0000 (01:12 +0000)]
Constify arguments to methods in LoopInfo.  NFC

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

8 years ago[PlaceSafepoints] Reduce dominator tree recalculation
Philip Reames [Wed, 13 May 2015 00:32:23 +0000 (00:32 +0000)]
[PlaceSafepoints] Reduce dominator tree recalculation

Reduce recalculation of the dominator tree by identifying all sites that will need a safepoint poll before doing any of the insertion. This allows us to invalidate the dominator info once, rather than once per safepoint poll inserted.

While I'm at it, update findLocationForEntrySafepoint to properly update the dom tree now that the interface has been made easy. When first written, it wasn't per comment in the code.

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

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

8 years ago[SLSR] handles non-canonicalized Mul candidates
Jingyue Wu [Wed, 13 May 2015 00:03:17 +0000 (00:03 +0000)]
[SLSR] handles non-canonicalized Mul candidates

such as (2 + B) * S.

Tested by @non_canonicalized in slsr-mul.ll

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

8 years ago[Statepoints] Support for "patchable" statepoints.
Sanjoy Das [Tue, 12 May 2015 23:52:24 +0000 (23:52 +0000)]
[Statepoints] Support for "patchable" statepoints.

Summary:
This change adds two new parameters to the statepoint intrinsic, `i64 id`
and `i32 num_patch_bytes`.  `id` gets propagated to the ID field
in the generated StackMap section.  If the `num_patch_bytes` is
non-zero then the statepoint is lowered to `num_patch_bytes` bytes of
nops instead of a call (the spill and reload code remains unchanged).
A non-zero `num_patch_bytes` is useful in situations where a language
runtime requires complete control over how a call is lowered.

This change brings statepoints one step closer to patchpoints.  With
some additional work (that is not part of this patch) it should be
possible to get rid of `TargetOpcode::STATEPOINT` altogether.

PlaceSafepoints generates `statepoint` wrappers with `id` set to
`0xABCDEF00` (the old default value for the ID reported in the stackmap)
and `num_patch_bytes` set to `0`.  This can be made more sophisticated
later.

Reviewers: reames, pgavlin, swaroop.sridhar, AndyAyers

Subscribers: llvm-commits

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

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

8 years ago[PlaceSafepoints] Followup to commit L237172
Philip Reames [Tue, 12 May 2015 23:39:23 +0000 (23:39 +0000)]
[PlaceSafepoints] Followup to commit L237172

Responding to review feedback from http://reviews.llvm.org/D9585

1) Remove a variable shadow by converting the outer loop to a range for loop.  We never really used the 'i' variable which was being shadowed.
2) Reduce DominatorTree recalculations by passing the DT to SplitEdge.

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

8 years agoCodeGen: ignore DEBUG_VALUE nodes in KILL tagging
Saleem Abdulrasool [Tue, 12 May 2015 23:36:18 +0000 (23:36 +0000)]
CodeGen: ignore DEBUG_VALUE nodes in KILL tagging

DEBUG_VALUE nodes do not take part in code generation.  Ignore them when
performing KILL updates.  Addresses PR23486.

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

8 years agoRevert r237175: [X86] Always return the sret parameter in eax/rax ...
Chandler Carruth [Tue, 12 May 2015 23:34:27 +0000 (23:34 +0000)]
Revert r237175: [X86] Always return the sret parameter in eax/rax ...

This commit broke an x86 test and the bots have been broken for well
over an hour now so I'm just reverting.

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

8 years ago[Unrolling] Refactor the start and step offsets to simplify overflow
Chandler Carruth [Tue, 12 May 2015 23:32:56 +0000 (23:32 +0000)]
[Unrolling] Refactor the start and step offsets to simplify overflow
checking and make the cache faster and smaller.

I had thought that using an APInt here would be useful, but I think
I was just wrong. Notably, we don't have to do any fancy overflow
checking, we can just bound the values as quite small and do the math in
a higher precision integer. I've switched to a signed integer so that
UBSan will even point out if we ever have integer overflow. I've added
various asserts to try to catch things as well and hoisted the overflow
checks so that we just leave the too-large offsets out of the SCEV-GEP
cache. This makes the value in the cache quite a bit smaller which is
probably worthwhile.

No functionality changed here (for trip counts under 1 billion).

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

8 years ago[lib/Fuzzer] A simple script to synchronise a fuzz test corpus with an external git...
Kostya Serebryany [Tue, 12 May 2015 23:19:12 +0000 (23:19 +0000)]
[lib/Fuzzer] A simple script to synchronise a fuzz test corpus with an external git repository.

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

8 years agoAllow the CMake option 'LLVM_ABI_BREAKING_CHECKS' to be undefined.
Eric Fiselier [Tue, 12 May 2015 22:49:18 +0000 (22:49 +0000)]
Allow the CMake option 'LLVM_ABI_BREAKING_CHECKS' to be undefined.

When building libc++abi in a standalone configuration the CMake option
'LLVM_ABI_BREAKING_CHECKS` will not be defined.

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

8 years agoCVP: Improve handling of Selects used as incoming PHI values
Bjorn Steinbrink [Tue, 12 May 2015 22:31:47 +0000 (22:31 +0000)]
CVP: Improve handling of Selects used as incoming PHI values

Summary:
If the branch that leads to the PHI node and the Select instruction
depend on correlated conditions, we might be able to directly use the
corresponding value from the Select instruction as the incoming value
for the PHI node, allowing later removal of the select instruction.

Subscribers: llvm-commits

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

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

8 years ago[RewriteStatepointsForGC] Extend base pointer to handle more cases w/vectors
Philip Reames [Tue, 12 May 2015 22:19:52 +0000 (22:19 +0000)]
[RewriteStatepointsForGC] Extend base pointer to handle more cases w/vectors

When relocating a pointer, we need to determine a base pointer for the derived pointer being relocated. We have limited support for handling a pointer extracted from a vector; the current code only handled the case where the entire vector was known to contain base pointers. This patch extends the reasoning to handle chains of insertelements where the indices are constants. This case turns out to be fairly common in vectorized code. We can now handle vectors which contains mixtures of base and derived pointers provided the insertelements use constant indices.

Note that this doesn't solve the general problem. To handle variable indexed insertelements, we'd need to scalarize and introduce conditional branching based on the index. Alternatively, we could eagerly scalarize, but the code structure doesn't currently make either fix easy. The patch also doesn't handle shufflevector or other vector manipulation for much the same reasons. I plan to defer this work until I have a motivating test case.

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

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

8 years ago[lib/Fuzzer] use sha1sum for the file hash
Kostya Serebryany [Tue, 12 May 2015 22:03:34 +0000 (22:03 +0000)]
[lib/Fuzzer] use sha1sum for the file hash

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

8 years agoTidy comments in SampleProfile header. NFC.
Diego Novillo [Tue, 12 May 2015 22:03:00 +0000 (22:03 +0000)]
Tidy comments in SampleProfile header. NFC.

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

8 years ago[PlaceSafepoints] Add missing "override" to PlaceBackedgeSafepointsImpl::runOnFunction
Justin Bogner [Tue, 12 May 2015 21:49:47 +0000 (21:49 +0000)]
[PlaceSafepoints] Add missing "override" to PlaceBackedgeSafepointsImpl::runOnFunction

Pointed out by -Winconsistent-missing-override.

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

8 years agoAdd missing #include and forward decl, found by modules build.
Richard Smith [Tue, 12 May 2015 21:49:03 +0000 (21:49 +0000)]
Add missing #include and forward decl, found by modules build.

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

8 years agoMergeFunctions: Two different sized allocas are *not* the same
Arnold Schwaighofer [Tue, 12 May 2015 21:42:22 +0000 (21:42 +0000)]
MergeFunctions: Two different sized allocas are *not* the same

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

8 years ago[Statepoints] Clean up statepoint argument accessors.
Pat Gavlin [Tue, 12 May 2015 21:33:48 +0000 (21:33 +0000)]
[Statepoints] Clean up statepoint argument accessors.

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

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

8 years agoRevert "ARM: Remove Itineraries for swift CPU"
Matthias Braun [Tue, 12 May 2015 21:28:39 +0000 (21:28 +0000)]
Revert "ARM: Remove Itineraries for swift CPU"

Reverting until I figure out the new lit failures.

This reverts commit r237179.

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

8 years agoInstrProf: Update name of compiler-rt routine for setting filename
Justin Bogner [Tue, 12 May 2015 21:23:09 +0000 (21:23 +0000)]
InstrProf: Update name of compiler-rt routine for setting filename

Patch by Teresa Johnson.

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

8 years ago[PlaceSafepoints] Switch to being a FunctionPass
Philip Reames [Tue, 12 May 2015 21:21:18 +0000 (21:21 +0000)]
[PlaceSafepoints] Switch to being a FunctionPass

The pass doesn't actually modify the module outside of the function being processed. The only confusing piece is that it both inserts calls and then inlines the resulting calls. Given that, it definitely invalidates module level analysis results, but many FunctionPasses do that.

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

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

8 years agofix formatting; NFC
Sanjay Patel [Tue, 12 May 2015 21:14:24 +0000 (21:14 +0000)]
fix formatting; NFC

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

8 years ago[PlaceSafepoints] Make internal helper pass a FunctionPass
Philip Reames [Tue, 12 May 2015 21:09:36 +0000 (21:09 +0000)]
[PlaceSafepoints] Make internal helper pass a FunctionPass

Switch from using a LoopPass to using a FunctionPass for the internal helper analysis pass. The next step is going to be to make this a true analysis pass which is required by the PlaceSafepoints pass itself.

p.s. The interesting semantic part here is that we're changing the iteration order over the loops. It shouldn't matter, but that's the reason to separate this into it's own distinct patch.

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

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

8 years agoARM: Remove Itineraries for swift CPU
Matthias Braun [Tue, 12 May 2015 21:07:54 +0000 (21:07 +0000)]
ARM: Remove Itineraries for swift CPU

They do more harm than good when used in the MachineScheduler as they
tend to take preference to register pressure minimsation which is more
important for swift.

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

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

8 years ago[PlaceSafepoints] Use analysis infrastructure to get dominator tree
Philip Reames [Tue, 12 May 2015 20:56:33 +0000 (20:56 +0000)]
[PlaceSafepoints] Use analysis infrastructure to get dominator tree

The old code computed dominators for every loop. This was terribly slow with no good reason. Just use the standard infrastructure for analysis passes.

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

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

8 years ago[X86] Always return the sret parameter in eax/rax, even on 32-bit
Reid Kleckner [Tue, 12 May 2015 20:56:32 +0000 (20:56 +0000)]
[X86] Always return the sret parameter in eax/rax, even on 32-bit

Summary:
This rule was always in the old SysV i386 ABI docs and the new ones that
H.J. Lu has put together, but we never noticed:

  EAX   scratch register; also used to return integer and pointer values
        from functions; also stores the address of a returned struct or union

Fixes PR23491.

Reviewers: majnemer

Subscribers: llvm-commits

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

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

8 years ago[PlaceSafepoints] Remove dependence on LoopSimplify
Philip Reames [Tue, 12 May 2015 20:43:48 +0000 (20:43 +0000)]
[PlaceSafepoints] Remove dependence on LoopSimplify

As a step towards getting rid of internal pass manager hack entirely, remove the need for loop simplify to run in the inner pass manager. The new code does produce slightly different loop structures, so this isn't technically NFC.

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

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

8 years ago[PATCH] [HEXAGON] Add a test program to verify calling convention
Sundeep Kushwaha [Tue, 12 May 2015 20:13:10 +0000 (20:13 +0000)]
[PATCH] [HEXAGON] Add a test program to verify calling convention
for large struct return by value.

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

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

8 years agoConvert PHI getIncomingValue() to foreach over incoming_values(). NFC.
Pete Cooper [Tue, 12 May 2015 20:05:31 +0000 (20:05 +0000)]
Convert PHI getIncomingValue() to foreach over incoming_values().  NFC.

We already had a method to iterate over all the incoming values of a PHI.  This just changes all eligible code to use it.

Ineligible code included anything which cared about the index, or was also trying to get the i'th incoming BB.

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

8 years agoAdd a const method to iterator over PHI incoming values.
Pete Cooper [Tue, 12 May 2015 20:05:23 +0000 (20:05 +0000)]
Add a const method to iterator over PHI incoming values.

This will be used in the next commit which converts code to use incoming_values().

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

8 years agoConstify method. NFC
Pete Cooper [Tue, 12 May 2015 20:05:20 +0000 (20:05 +0000)]
Constify method.  NFC

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

8 years ago[Statepoints] Split the calling convention and statepoint flags operand to STATEPOINT...
Pat Gavlin [Tue, 12 May 2015 19:50:19 +0000 (19:50 +0000)]
[Statepoints] Split the calling convention and statepoint flags operand to STATEPOINT into two separate operands.

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

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

8 years agoStrip trailing whitespace. NFC
Douglas Katzman [Tue, 12 May 2015 19:42:31 +0000 (19:42 +0000)]
Strip trailing whitespace. NFC

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

8 years agoR600/SI: Fix bug in VGPR spilling
Tom Stellard [Tue, 12 May 2015 18:59:17 +0000 (18:59 +0000)]
R600/SI: Fix bug in VGPR spilling

AMDGPU::SI_SPILL_V96_RESTORE was missing from a switch statement, which
caused the srsrc and soffset register to not be set correctly.

This commit replaces the switch statement with a SITargetInfo query
to make sure all spill instructions are covered.

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

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

8 years ago[lib/Fuzzer] guess the right number of workers if -jobs=N is given but -workers=M...
Kostya Serebryany [Tue, 12 May 2015 18:51:57 +0000 (18:51 +0000)]
[lib/Fuzzer] guess the right number of workers if -jobs=N is given but -workers=M is not. Update the docs.

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

8 years agoRevert r237157, "YAML: Fix typos. NFC".
Alex Lorenz [Tue, 12 May 2015 17:44:32 +0000 (17:44 +0000)]
Revert r237157, "YAML: Fix typos. NFC".

'Iff' isn't a typo, it's a shorthand for 'if and only if'.

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

8 years ago[mips][microMIPSr6] Implement SELEQZ and SELNEZ instructions
Jozef Kolek [Tue, 12 May 2015 17:39:32 +0000 (17:39 +0000)]
[mips][microMIPSr6] Implement SELEQZ and SELNEZ instructions

This patch implements SELEQZ and SELNEZ instructions using mapping.

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

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

8 years agoYAML: Fix typos. NFC.
Alex Lorenz [Tue, 12 May 2015 17:31:17 +0000 (17:31 +0000)]
YAML: Fix typos. NFC.

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

8 years agoReimplement heuristic for estimating complete-unroll optimization effects.
Michael Zolotukhin [Tue, 12 May 2015 17:20:03 +0000 (17:20 +0000)]
Reimplement heuristic for estimating complete-unroll optimization effects.

Summary:
This patch reimplements heuristic that tries to estimate optimization beneftis
from complete loop unrolling.

In this patch I kept the minimal changes - e.g. I removed code handling
branches and folding compares. That's a promising area, but now there
are too many questions to discuss before we can enable it.

Test Plan: Tests are included in the patch.

Reviewers: hfinkel, chandlerc

Subscribers: llvm-commits

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

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

8 years ago[Mips] Return false for isFPCloseToIncomingSP()
Petar Jovanovic [Tue, 12 May 2015 17:14:05 +0000 (17:14 +0000)]
[Mips] Return false for isFPCloseToIncomingSP()

On Mips, frame pointer points to the same side of the frame as the stack
pointer. This function is used to decide where to put register scavenging
spill slot. So far, it was put on the wrong side of the frame, and thus it
was too far away from $fp when frame was larger than 2^15 bytes.

Patch by Vladimir Radosavljevic.

http://reviews.llvm.org/D8895

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

8 years agoR600/SI: add pass to mark CF live ranges as non-spillable
Tom Stellard [Tue, 12 May 2015 17:13:02 +0000 (17:13 +0000)]
R600/SI: add pass to mark CF live ranges as non-spillable

Spilling can insert instructions almost anywhere, and this can mess
up control flow lowering in a multitude of ways, due to instruction
reordering. Let's sort this out the easy way: never spill registers
involved with control flow, i.e. saved EXEC masks.

Unfortunately, this does not work at all with optimizations disabled,
as the register allocator ignores spill weights. This should be
addressed in a future commit.

The test was reduced from the "stacks" shader of [1]. Some issues
trigger the machine verifier while another one is checked manually.

[1] http://madebyevan.com/webgl-path-tracing/

v2: only insert pass with optimizations enabled, merge test runs.

Patch by: Grigori Goronzy

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

8 years agoChanged renaming of local symbols by inserting a dot vefore the numeric suffix.
Sunil Srivastava [Tue, 12 May 2015 16:47:30 +0000 (16:47 +0000)]
Changed renaming of local symbols by inserting a dot vefore the numeric suffix.
One code change and several test changes to match that
details in http://reviews.llvm.org/D9481

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

8 years agoDelete dead code. NFC
Jonathan Roelofs [Tue, 12 May 2015 16:45:53 +0000 (16:45 +0000)]
Delete dead code. NFC

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

8 years agoComment disambiguation.
Douglas Katzman [Tue, 12 May 2015 15:45:56 +0000 (15:45 +0000)]
Comment disambiguation.

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

8 years ago[DWARF] Add CIE header fields address_size and segment_size when generating dwarf-4
Keith Walker [Tue, 12 May 2015 15:25:08 +0000 (15:25 +0000)]
[DWARF] Add CIE header fields address_size and segment_size when generating dwarf-4

The DWARF-4 specification added 2 new fields in the CIE header called
address_size and segment_size.
Create these 2 new fields when generating dwarf-4 CIE entries, print out
the new fields when dumping the CIE and update tests

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

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

8 years agouse 'auto' to improve readability; NFC
Sanjay Patel [Tue, 12 May 2015 15:15:55 +0000 (15:15 +0000)]
use 'auto' to improve readability; NFC

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

8 years agoR600/SI: Update tablegen defs to avoid restoring spilled sgprs to m0
Tom Stellard [Tue, 12 May 2015 15:00:53 +0000 (15:00 +0000)]
R600/SI: Update tablegen defs to avoid restoring spilled sgprs to m0

We had code to do this in SIRegisterInfo::eliminateFrameIndex(), but
it is easier to just change the definition of SI_SPILL_S32_RESTORE to
only allow numbered sgprs.

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

8 years agoR600/SI: Remove M0Reg register class
Tom Stellard [Tue, 12 May 2015 15:00:52 +0000 (15:00 +0000)]
R600/SI: Remove M0Reg register class

It is no longer used.

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

8 years agoR600/SI: Remove explicit m0 operand from DS instructions
Tom Stellard [Tue, 12 May 2015 15:00:49 +0000 (15:00 +0000)]
R600/SI: Remove explicit m0 operand from DS instructions

Instead add m0 as an implicit operand.  This helps avoid spills
of the m0 register in some cases.

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

8 years agoR600/SI: Remove explicit m0 operand from v_interp instructions
Tom Stellard [Tue, 12 May 2015 15:00:46 +0000 (15:00 +0000)]
R600/SI: Remove explicit m0 operand from v_interp instructions

Instead add m0 as an implicit operand.  This helps avoid spills
of the m0 register in some cases.

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

8 years agofix typos, grammar; NFC
Sanjay Patel [Tue, 12 May 2015 14:52:42 +0000 (14:52 +0000)]
fix typos, grammar; NFC

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

8 years agoR600/SI: Make sendmsg test more strict
Tom Stellard [Tue, 12 May 2015 14:18:16 +0000 (14:18 +0000)]
R600/SI: Make sendmsg test more strict

We want to make sure that the m0 copies are being cse'd.

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

8 years agoR600/SI: Remove explicit m0 operand from s_sendmsg
Tom Stellard [Tue, 12 May 2015 14:18:14 +0000 (14:18 +0000)]
R600/SI: Remove explicit m0 operand from s_sendmsg

Instead add m0 as an implicit operand.  This allows us to avoid using
the M0Reg register class and eliminates a number of unnecessary spills
when using s_sendmsg instructions.  This impacts one shader in the
shader-db:

SGPRS: 48 -> 40 (-16.67 %)
VGPRS: 112 -> 108 (-3.57 %)
Code Size: 40132 -> 38796 (-3.33 %) bytes
LDS: 0 -> 0 (0.00 %) blocks
Scratch: 2048 -> 0 (-100.00 %) bytes per wave

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

8 years agoR600/SI: Replace TRI->getRegClass(Reg) with TRI->getPhysRegClass(Reg)
Tom Stellard [Tue, 12 May 2015 14:18:11 +0000 (14:18 +0000)]
R600/SI: Replace TRI->getRegClass(Reg) with TRI->getPhysRegClass(Reg)

TRI->getRegClass() takes a register class ID, not a register.  We were
using this incorrectly in a few places.

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

8 years agoAVX-512, X86: Added lowering for shift operations for SKX.
Elena Demikhovsky [Tue, 12 May 2015 13:25:46 +0000 (13:25 +0000)]
AVX-512, X86: Added lowering for shift operations for SKX.
The other changes in the LowerShift() are not functional,
just to make the code more convenient.
So, the functional changes for SKX only.

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

8 years ago[ARM] Use AEABI aligned function variants
John Brawn [Tue, 12 May 2015 13:13:38 +0000 (13:13 +0000)]
[ARM] Use AEABI aligned function variants

AEABI defines aligned variants of memcpy etc. that can be faster than
the default version due to not having to do alignment checks. When
emitting target code for these functions make use of these aligned
variants if possible. Also convert memset to memclr if possible.

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

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

8 years agoReverse ordering of base and derived pointer during safepoint lowering.
Igor Laevsky [Tue, 12 May 2015 13:12:14 +0000 (13:12 +0000)]
Reverse ordering of base and derived pointer during safepoint lowering.

According to the documentation in StackMap section for the safepoint we should have:
"The first Location in each pair describes the base pointer for the object. The second is the derived pointer actually being relocated."
But before this change we emitted them in reverse order - derived pointer first, base pointer second.

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

8 years ago[X86] Remove useless target specific combine on TRUNCATE dag nodes.
Andrea Di Biagio [Tue, 12 May 2015 12:34:22 +0000 (12:34 +0000)]
[X86] Remove useless target specific combine on TRUNCATE dag nodes.

Before revision 171146, function 'PerformTruncateCombine' used to perform
a premature lowering of TRUNCATE dag nodes.
Revision 171146 then moved all the logic implemented by PerformTruncateCombine
to a custom lowering hook. However, that revision forgot to delete
function PerformTruncateCombine from the code.

This patch removes function 'PerformTruncateCombine' since it has no effect
on the SelectionDAG. No functional change intended.

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

8 years ago[mips][FastISel] Handle calls with non legal types i8 and i16.
Vasileios Kalintiris [Tue, 12 May 2015 12:29:17 +0000 (12:29 +0000)]
[mips][FastISel] Handle calls with non legal types i8 and i16.

Summary: Allow calls with non legal integer types based on i8 and i16 to be processed by mips fast-isel.

Based on a patch by Reed Kotler.

Test Plan:
"Make check" test forthcoming.
Test-suite passes at O0/O2 and with mips32 r1/r2

Reviewers: rkotler, dsanders

Subscribers: llvm-commits, rfuhler

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

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

8 years ago[mips][FastISel] Simplify callabi.ll by using multiple check prefixes.
Vasileios Kalintiris [Tue, 12 May 2015 12:17:11 +0000 (12:17 +0000)]
[mips][FastISel] Simplify callabi.ll by using multiple check prefixes.

Reviewers: dsanders

Subscribers: llvm-commits

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

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

8 years ago[mips][FastISel] Allow computation of addresses from constant expressions.
Vasileios Kalintiris [Tue, 12 May 2015 12:08:31 +0000 (12:08 +0000)]
[mips][FastISel] Allow computation of addresses from constant expressions.

Summary:
Try to compute addresses when the offset from a memory location is a constant
expression.

Based on a patch by Reed Kotler.

Test Plan:
Passes test-suite for -O0/O2 and mips 32 r1/r2

Reviewers: rkotler, dsanders

Subscribers: llvm-commits, aemerson, rfuhler

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

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

8 years agoChange TargetParser enum names to avoid macro conflicts (llvm)
Renato Golin [Tue, 12 May 2015 10:33:58 +0000 (10:33 +0000)]
Change TargetParser enum names to avoid macro conflicts (llvm)

sys/time.h on Solaris (and possibly other systems) defines "SEC" as "1"
using a cpp macro.  The result is that this fails to compile.

Fixes https://llvm.org/PR23482

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

8 years agoAVX-512: asm parser errors check
Elena Demikhovsky [Tue, 12 May 2015 09:47:23 +0000 (09:47 +0000)]
AVX-512: asm parser errors check
I reverted the error check that was removed in 236416.
I put the it in a separate file.

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

8 years agoAVX-512: select operation for i1 vectors
Elena Demikhovsky [Tue, 12 May 2015 09:36:52 +0000 (09:36 +0000)]
AVX-512: select operation for i1 vectors
like: select i1 %cond, <16 x i1> %a, <16 x i1> %b.
I added pseudo-CMOV patterns to resolve the "select".
Added tests for KNL and SKX.

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

8 years ago[X86] DAGCombine should not assume arbitrary vector types are simple
Michael Kuperstein [Tue, 12 May 2015 07:33:07 +0000 (07:33 +0000)]
[X86] DAGCombine should not assume arbitrary vector types are simple

The X86-specific DAGCombine for stores should not assume vector types are always simple.
This fixes PR23476.

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

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

8 years agoRemove unnecessary forward declaration.
Craig Topper [Tue, 12 May 2015 06:09:57 +0000 (06:09 +0000)]
Remove unnecessary forward declaration.

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

8 years agoRemove unnecessary variables by folding calls into for loop header. NFC.
Craig Topper [Tue, 12 May 2015 05:25:10 +0000 (05:25 +0000)]
Remove unnecessary variables by folding calls into for loop header. NFC.

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

8 years ago[lib/Fuzzer] remove the -dfsan=1 flag, just use -use_traces=1 (w/ or w/o dfsan)
Kostya Serebryany [Tue, 12 May 2015 01:58:34 +0000 (01:58 +0000)]
[lib/Fuzzer] remove the -dfsan=1 flag, just use -use_traces=1 (w/ or w/o dfsan)

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

8 years ago[lib/Fuzzer] detach the pulse thread instad of joining it
Kostya Serebryany [Tue, 12 May 2015 01:43:20 +0000 (01:43 +0000)]
[lib/Fuzzer] detach the pulse thread instad of joining it

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

8 years agoMigrate existing backends that care about software floating point
Eric Christopher [Tue, 12 May 2015 01:26:05 +0000 (01:26 +0000)]
Migrate existing backends that care about software floating point
to use the information in the module rather than TargetOptions.

We've had and clang has used the use-soft-float attribute for some
time now so have the backends set a subtarget feature based on
a particular function now that subtargets are created based on
functions and function attributes.

For the one middle end soft float check go ahead and create
an overloadable TargetLowering::useSoftFloat function that
just checks the TargetSubtargetInfo in all cases.

Also remove the command line option that hard codes whether or
not soft-float is set by using the attribute for all of the
target specific test cases - for the generic just go ahead and
add the attribute in the one case that showed up.

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

8 years agoFixing memory leak
Andrew Kaylor [Tue, 12 May 2015 00:13:51 +0000 (00:13 +0000)]
Fixing memory leak

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

8 years agoRefactoring gc_relocate related code in CodeGenPrepare.cpp
Sanjoy Das [Mon, 11 May 2015 23:47:30 +0000 (23:47 +0000)]
Refactoring gc_relocate related code in CodeGenPrepare.cpp

Summary:
The original code inserted new instructions by following a
Create->Remove->ReInsert flow. This patch removes the unnecessary
Remove->ReInsert part by setting up the InsertPoint correctly at the
very beginning. This change does not introduce any functionality change.

Patch by Chen Li!

Reviewers: reames, AndyAyers, sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

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

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

8 years agoRename variables in gc_relocate related functions to follow LLVM's naming conventions.
Sanjoy Das [Mon, 11 May 2015 23:47:27 +0000 (23:47 +0000)]
Rename variables in gc_relocate related functions to follow LLVM's naming conventions.

Summary:
This patch is to rename some variables to CamelCase in gc_relocate
related functions. There is no functionality change.

Patch by Chen Li!

Reviewers: reames, AndyAyers, sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

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

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

8 years ago[lib/Fuzzer] don't record traces when trace collection is off
Kostya Serebryany [Mon, 11 May 2015 23:25:28 +0000 (23:25 +0000)]
[lib/Fuzzer] don't record traces when trace collection is off

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

8 years ago[MemCpyOpt] Look at any dependency -not just source- for memset+memcpy.
Ahmed Bougacha [Mon, 11 May 2015 23:09:46 +0000 (23:09 +0000)]
[MemCpyOpt] Look at any dependency -not just source- for memset+memcpy.

This fixes another miscompile introduced by r235232: when there was a
dependency on the memcpy destination other than the memset, we would
ignore it, because we only looked at the source dependency.

It was a mistake to use SrcDepInfo.  Instead, just use DepInfo.

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

8 years agoSimplify a return expression and an access to an alloca's allocated type
David Blaikie [Mon, 11 May 2015 23:09:25 +0000 (23:09 +0000)]
Simplify a return expression and an access to an alloca's allocated type

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

8 years ago[WinEH] Handle nested landing pads that return directly to the parent function.
Andrew Kaylor [Mon, 11 May 2015 23:06:02 +0000 (23:06 +0000)]
[WinEH] Handle nested landing pads that return directly to the parent function.

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

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

8 years agoAdd more missing #includes, found by modules build.
Richard Smith [Mon, 11 May 2015 22:41:07 +0000 (22:41 +0000)]
Add more missing #includes, found by modules build.

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

8 years agoAdd missing #include, found by modules build.
Richard Smith [Mon, 11 May 2015 22:32:06 +0000 (22:32 +0000)]
Add missing #include, found by modules build.

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

8 years agoAdd missing #includes, found by modules build.
Richard Smith [Mon, 11 May 2015 22:31:40 +0000 (22:31 +0000)]
Add missing #includes, found by modules build.

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

8 years agoReaddress r236990, use of static members on a non-static variable.
David Blaikie [Mon, 11 May 2015 22:20:48 +0000 (22:20 +0000)]
Readdress r236990, use of static members on a non-static variable.

The TargetRegistry is just a namespace-like class, instantiated in one
place to use a range-based for loop. Instead, expose access to the
registry via a range-based 'targets()' function instead. This makes most
uses a bit awkward/more verbose - but eventually we should just add a
range-based find_if function which will streamline these functions. I'm
happy to mkae them a bit awkward in the interim as encouragement to
improve the algorithms in time.

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

8 years agoFix tablegen's PrintFatalError function to run registered file
James Y Knight [Mon, 11 May 2015 22:17:13 +0000 (22:17 +0000)]
Fix tablegen's PrintFatalError function to run registered file
cleanups.

Also, change code in tablegen which printed a message and then called
"exit(1)" to use PrintFatalError, instead.

This fixes instances where an empty output file was left behind after
a failed tablegen invocation, which would confuse subsequent ninja
runs into not attempting to rebuild.

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

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

8 years ago[lib/Fuzzer] when running multiple fuzzing processes, print something every 10 minute...
Kostya Serebryany [Mon, 11 May 2015 21:31:51 +0000 (21:31 +0000)]
[lib/Fuzzer] when running multiple fuzzing processes, print something every 10 minutes to avoid buildbot timeouts

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

8 years agoFix input validation issues in llvm-as/llvm-dis
Alexey Samsonov [Mon, 11 May 2015 21:20:20 +0000 (21:20 +0000)]
Fix input validation issues in llvm-as/llvm-dis

Summary:
1. llvm-as/llvm-dis tools do not check for input filename length.
2. llvm-dis does not verify the `Streamer` variable against `nullptr` properly, so the `M` variable could be uninitialized (e.g. if the input file does not exist) leading to null dref.

Patch by Lenar Safin!

Reviewers: samsonov

Reviewed By: samsonov

Subscribers: samsonov, llvm-commits

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

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

8 years ago[lib/Fuzzer] rename FuzzerDFSan.cpp to FuzzerTraceState.cpp; update comments. NFC...
Kostya Serebryany [Mon, 11 May 2015 21:16:27 +0000 (21:16 +0000)]
[lib/Fuzzer] rename FuzzerDFSan.cpp to FuzzerTraceState.cpp; update comments. NFC expected

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

8 years agopropagate IR-level fast-math-flags to DAG nodes; 2nd try; NFC
Sanjay Patel [Mon, 11 May 2015 21:07:09 +0000 (21:07 +0000)]
propagate IR-level fast-math-flags to DAG nodes; 2nd try; NFC

This is a less ambitious version of:
http://reviews.llvm.org/rL236546

because that was reverted in:
http://reviews.llvm.org/rL236600

because it caused memory corruption that wasn't related to FMF
but was actually due to making nodes with 2 operands derive from a
plain SDNode rather than a BinarySDNode.

This patch adds the minimum plumbing necessary to use IR-level
fast-math-flags (FMF) in the backend without actually using
them for anything yet. This is a follow-on to:
http://reviews.llvm.org/rL235997

...which split the existing nsw / nuw / exact flags and FMF
into their own struct.

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

8 years ago[LoopIdiomRecognize] Transform backedge-taken count check into an assertion.
Davide Italiano [Mon, 11 May 2015 21:02:34 +0000 (21:02 +0000)]
[LoopIdiomRecognize] Transform backedge-taken count check into an assertion.

runOnCountable() allowed the caller to call on a loop without a
predictable backedge-taken count. Change the code so that only loops
with computable backdge-count can call this function, in order to catch
abuses.

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

8 years ago[lib/Fuzzer] add a trace-based mutatation logic. Same idea as with DFSan-based mutato...
Kostya Serebryany [Mon, 11 May 2015 20:51:19 +0000 (20:51 +0000)]
[lib/Fuzzer] add a trace-based mutatation logic. Same idea as with DFSan-based mutator, but instead of relying on taint  tracking, try to find the data directly in the input. More (logic and comments) to go.

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

8 years agoFixing build warnings
Andrew Kaylor [Mon, 11 May 2015 20:45:11 +0000 (20:45 +0000)]
Fixing build warnings

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

8 years ago[WinEH] Update exception numbering to give handlers their own base state.
Andrew Kaylor [Mon, 11 May 2015 19:41:19 +0000 (19:41 +0000)]
[WinEH] Update exception numbering to give handlers their own base state.

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

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

8 years agogroup getNode() variants by purpose and add comments; NFC
Sanjay Patel [Mon, 11 May 2015 19:34:10 +0000 (19:34 +0000)]
group getNode() variants by purpose and add comments; NFC

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

8 years ago[RewriteStatepointsForGC] Fix a bug on creating gc_relocate for pointer to vector...
Sanjoy Das [Mon, 11 May 2015 18:49:34 +0000 (18:49 +0000)]
[RewriteStatepointsForGC] Fix a bug on creating gc_relocate for pointer to vector of pointers

Summary:
In RewriteStatepointsForGC pass, we create a gc_relocate intrinsic for
each relocated pointer, and the gc_relocate has the same type with the
pointer. During the creation of gc_relocate intrinsic, llvm requires to
mangle its type. However, llvm does not support mangling of all possible
types. RewriteStatepointsForGC will hit an assertion failure when it
tries to create a gc_relocate for pointer to vector of pointers because
mangling for vector of pointers is not supported.

This patch changes the way RewriteStatepointsForGC pass creates
gc_relocate. For each relocated pointer, we erase the type of pointers
and create an unified gc_relocate of type i8 addrspace(1)*. Then a
bitcast is inserted to convert the gc_relocate to the correct type. In
this way, gc_relocate does not need to deal with different types of
pointers and the unsupported type mangling is no longer a problem. This
change would also ease further merge when LLVM erases types of pointers
and introduces an unified pointer type.

Some minor changes are also introduced to gc_relocate related part in
InstCombineCalls, CodeGenPrepare, and Verifier accordingly.

Patch by Chen Li!

Reviewers: reames, AndyAyers, sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

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

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

8 years agoLiveRangeCalc: Improve error messages on malformed IR
Matthias Braun [Mon, 11 May 2015 18:47:47 +0000 (18:47 +0000)]
LiveRangeCalc: Improve error messages on malformed IR

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