Bill Schmidt [Sun, 28 Jul 2013 02:13:24 +0000 (02:13 +0000)]
Revert 187318
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187319
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Sun, 28 Jul 2013 02:08:13 +0000 (02:08 +0000)]
[PowerPC] Remove unnecessary preprocessor checking.
The tests !defined(__ppc__) && !defined(__powerpc__) are not needed
or helpful when verifying that code is being compiled for a 64-bit
target. The simpler test provided by this revision is sufficient to
tell if the target is 64-bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187318
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Sat, 27 Jul 2013 23:28:47 +0000 (23:28 +0000)]
Update the comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187316
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sat, 27 Jul 2013 21:49:25 +0000 (21:49 +0000)]
[APFloat] Make all arithmetic operations with NaN produce positive NaNs.
IEEE-754R 1.4 Exclusions states that IEEE-754R does not specify the
interpretation of the sign of NaNs. In order to remove an irrelevant
variable that most floating point implementations do not use,
standardize add, sub, mul, div, mod so that operating anything with
NaN always yields a positive NaN.
In a later commit I am going to update the APIs for creating NaNs so
that one can not even create a negative NaN.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187314
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sat, 27 Jul 2013 21:49:21 +0000 (21:49 +0000)]
[APFloat] Move setting fcNormal in zeroSignificand() to calling code.
Zeroing the significand of a floating point number does not necessarily cause a
floating point number to become finite non zero. For instance, if one has a NaN,
zeroing the significand will cause it to become +/- infinity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187313
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sat, 27 Jul 2013 21:49:19 +0000 (21:49 +0000)]
[APFloat] Removed nextafter from missing operations since it is implemented in APFloat::next.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187312
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Sat, 27 Jul 2013 20:20:28 +0000 (20:20 +0000)]
Re-enabling some more MSVC warnings; all of these compile cleanly with no further changes required.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187310
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sat, 27 Jul 2013 19:22:28 +0000 (19:22 +0000)]
Minor code simplification suggested by Duncan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187309
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 27 Jul 2013 14:14:43 +0000 (14:14 +0000)]
DwarfDebug: MD5 is always little endian, bswap on big endian platforms.
This makes LLVM emit the same signature regardless of host and target endianess.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187304
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 27 Jul 2013 11:58:26 +0000 (11:58 +0000)]
Create a constant pool symbol for the GOT in the ARMCGBR the same way we
do in the SDag when lowering references to the GOT: use
ARMConstantPoolSymbol rather than creating a dummy global variable. The
computation of the alignment still feels weird (it uses IR types and
datalayout) but it preserves the exact previous behavior. This change
fixes the memory leak of the global variable detected on the valgrind
leak checking bot.
Thanks to Benjamin Kramer for pointing me at ARMConstantPoolSymbol to
handle this use case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187303
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 27 Jul 2013 11:23:08 +0000 (11:23 +0000)]
Fix yet another memory leak found by the vg-leak bot. Folks (including
me) should start watching this bot more as its catching lots of bugs.
The fix here is to not construct the global if we aren't going to need
it. That's cheaper anyways, and globals have highly predictable types in
practice. I've added an assert to catch skew between our manual testing
of the type and the actual type just for paranoia's sake.
Note that this pattern is actually fine in most globals because when you
build a global with a module it automatically is moved to be owned by
that module. But here, we're in isel and don't really want to do that.
The solution of not creating a global is simpler anyways.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187302
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 27 Jul 2013 11:09:58 +0000 (11:09 +0000)]
Fix a memory leak in the debug emission by simply not allocating memory.
There doesn't appear to be any reason to put this variable on the heap.
I'm suspicious of the LexicalScope above that we stuff in a map and then
delete afterward, but I'm just trying to get the valgrind bot clean.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187301
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 27 Jul 2013 10:48:45 +0000 (10:48 +0000)]
Fix a memory leak in the hexagon scheduler. We call initialize here more
than once, and the second time through we leaked memory. Found thanks to
the vg-leak bot, but I can't locally reproduce it with valgrind. The
debugger confirms that it is in fact leaking here.
This whole code is totally gross. Why is initialize being called on each
runOnFunction??? Why aren't these OwningPtr<>s, and why aren't their
lifetimes better defined? Anyways, this is just a surgical change to
help out the leak checking bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187299
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 27 Jul 2013 10:17:49 +0000 (10:17 +0000)]
Don't use all the #ifdefs to hide the stats counters and instead rely on
their being optimized out in debug mode. Realistically, this just isn't
going to be the slow part anyways. This also fixes unused variable
warnings that are breaking LLD build bots. =/ I didn't see these at
first, and kept losing track of the fact that they were broken.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187297
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 27 Jul 2013 09:43:30 +0000 (09:43 +0000)]
Merge the removal of dead instructions and lifetime markers with the
analysis of the alloca. We don't need to visit all the users twice for
this. We build up a kill list during the analysis and then just process
it afterward. This recovers the tiny bit of performance lost by moving
to the visitor based analysis system as it removes one entire use-list
walk from mem2reg. In some cases, this is now faster than mem2reg was
previously.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187296
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Sat, 27 Jul 2013 03:35:44 +0000 (03:35 +0000)]
Re-enabling a warning in MSVC mode now that r187292 fixed the only instance of the warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187293
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Sat, 27 Jul 2013 02:54:44 +0000 (02:54 +0000)]
SimplifyCFG: Add missing tests from r187278
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187291
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sat, 27 Jul 2013 01:26:30 +0000 (01:26 +0000)]
Update this CMakeLists.txt for r187283 too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187286
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Sat, 27 Jul 2013 01:26:08 +0000 (01:26 +0000)]
Debug Info Verifier: verify SPs in llvm.dbg.sp.
Also always add DIType, DISubprogram and DIGlobalVariable to the list
in DebugInfoFinder without checking them, so we can verify them later
on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187285
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sat, 27 Jul 2013 01:25:51 +0000 (01:25 +0000)]
Also update CMakeLists.txt for r187283.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187284
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sat, 27 Jul 2013 01:24:00 +0000 (01:24 +0000)]
Reimplement isPotentiallyReachable to make nocapture deduction much stronger.
Adds unit tests for it too.
Split BasicBlockUtils into an analysis-half and a transforms-half, and put the
analysis bits into a new Analysis/CFG.{h,cpp}. Promote isPotentiallyReachable
into llvm::isPotentiallyReachable and move it into Analysis/CFG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187283
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Sat, 27 Jul 2013 00:13:11 +0000 (00:13 +0000)]
Re-enabling some more MSVC warnings; all of these compile cleanly with no further changes required.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187279
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Sat, 27 Jul 2013 00:01:07 +0000 (00:01 +0000)]
SimplifyCFG: Use parallel-and and parallel-or mode to consolidate branch conditions
Merge consecutive if-regions if they contain identical statements.
Both transformations reduce number of branches. The transformation
is guarded by a target-hook, and is currently enabled only for +R600,
but the correctness has been tested on X86 target using a variety of
CPU benchmarks.
Patch by: Mei Ye
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187278
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jul 2013 23:22:43 +0000 (23:22 +0000)]
Move the default back to pipefail. I accidentally reverted it before.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187271
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jul 2013 23:17:38 +0000 (23:17 +0000)]
Propagate pipefail when cloning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187268
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Fri, 26 Jul 2013 23:07:55 +0000 (23:07 +0000)]
SLP Vectorier: Don't vectorize really short chains because they are already handled by the SelectionDAG store-vectorizer, which does a better job in deciding when to vectorize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187267
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Fri, 26 Jul 2013 22:53:11 +0000 (22:53 +0000)]
SLP Vectorizer: Disable the vectorization of non power of two chains, such as <3 x float>, because we dont have a good cost model for these types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187265
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jul 2013 22:32:58 +0000 (22:32 +0000)]
Use pipefail when available.
This change makes test with RUN lines like
RUN: opt ... | FileCheck
fail if opt fails, even if it prints what FileCheck wants. Enabling this
found some interesting cases of broken tests that were not being noticed
because opt (or some other tool) was crashing late.
Pipefail is used when the shell supports it or when using the internal
python based tester.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187261
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jul 2013 22:31:26 +0000 (22:31 +0000)]
next batch of -disable-debug-info-verifier
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187260
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jul 2013 22:13:57 +0000 (22:13 +0000)]
Revert "[PowerPC] Improve consistency in use of __ppc__, __powerpc__, etc."
This reverts commit r187248. It broke many bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187254
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Fri, 26 Jul 2013 22:06:21 +0000 (22:06 +0000)]
Fix variable name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187253
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Fri, 26 Jul 2013 22:03:03 +0000 (22:03 +0000)]
Re-enabling the C4065 warning for MSVC builds as it no longer fires due to tablegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187252
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Fri, 26 Jul 2013 21:50:30 +0000 (21:50 +0000)]
Use a non-c'tor for converting a boolean into a StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187250
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Fri, 26 Jul 2013 21:40:29 +0000 (21:40 +0000)]
When InstCombine tries to fold away (fsub x, (fneg y)) into (fadd x, y), it is
also worthwhile for it to look through FP extensions and truncations, whose
application commutes with fneg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187249
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Fri, 26 Jul 2013 21:39:15 +0000 (21:39 +0000)]
[PowerPC] Improve consistency in use of __ppc__, __powerpc__, etc.
Both GCC and LLVM will implicitly define __ppc__ and __powerpc__ for
all PowerPC targets, whether 32- or 64-bit. They will both implicitly
define __ppc64__ and __powerpc64__ for 64-bit PowerPC targets, and not
for 32-bit targets. We cannot be sure that all other possible
compilers used to compile Clang/LLVM define both __ppc__ and
__powerpc__, for example, so it is best to check for both when relying
on either inside the Clang/LLVM code base.
This patch makes sure we always check for both variants. In addition,
it fixes one unnecessary check in lib/Target/PowerPC/PPCJITInfo.cpp.
(At least one of __ppc__ and __powerpc__ should always be defined when
compiling for a PowerPC target, no matter which compiler is used, so
testing for them is unnecessary.)
There are some places in the compiler that check for other variants,
like __POWERPC__ and _POWER, and I have left those in place. There is
no need to add them elsewhere. This seems to be in Apple-specific
code, and I won't take a chance on breaking it.
There is no intended change in behavior; thus, no test cases are
added.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187248
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 26 Jul 2013 21:16:25 +0000 (21:16 +0000)]
Use more parens to clarify assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187247
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 26 Jul 2013 21:07:18 +0000 (21:07 +0000)]
Remove addLetterToHash, no functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187245
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 26 Jul 2013 20:58:55 +0000 (20:58 +0000)]
[mips] Implement llvm.trap intrinsic.
Patch by Sasa Stankovic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187244
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 26 Jul 2013 20:51:20 +0000 (20:51 +0000)]
[mips] Fix FP conditional move instructions to have explicit FP condition code
register operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187242
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jul 2013 20:44:45 +0000 (20:44 +0000)]
Add missing 'n'.
Thanks to Han Finkel for noticing it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187241
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 26 Jul 2013 20:13:47 +0000 (20:13 +0000)]
[mips] Fix FP branch instructions to have explicit FP condition code register
operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187238
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Fri, 26 Jul 2013 20:04:30 +0000 (20:04 +0000)]
Debug Info Verifier: enable verification of DICompileUnit.
We used to call Verify before adding DICompileUnit to the list, and now we
remove the check and always add DICompileUnit to the list in DebugInfoFinder,
so we can verify them later on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187237
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 26 Jul 2013 19:03:48 +0000 (19:03 +0000)]
[mips] Increase the number of floating point condition code registers to eight.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187234
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 26 Jul 2013 19:01:56 +0000 (19:01 +0000)]
[mips] Fix floating point branch, comparison, and conditional move instructions
to have register FCC0 (the first floating point condition code register) in
their Uses/Defs list.
No intended functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187233
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 26 Jul 2013 18:50:42 +0000 (18:50 +0000)]
[mips] Delete register print method MipsInstPrinter::printCPURegs that is not
needed. The generic method printOperand will do.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187231
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 26 Jul 2013 18:34:25 +0000 (18:34 +0000)]
[mips] Print instructions "beq", "bne" and "or" using assembler pseudo
instructions "beqz", "bnez" and "move", when possible.
beq $2, $zero, $L1 => beqz $2, $L1
bne $2, $zero, $L1 => bnez $2, $L1
or $2, $3, $zero => move $2, $3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187229
91177308-0d34-0410-b5e6-
96231b3b80d8
Stephen Lin [Fri, 26 Jul 2013 18:09:50 +0000 (18:09 +0000)]
Remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187226
91177308-0d34-0410-b5e6-
96231b3b80d8
Stephen Lin [Fri, 26 Jul 2013 17:55:00 +0000 (17:55 +0000)]
Correct case of m_UIToFp to m_UIToFP to match instruction name, add m_SIToFP for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187225
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 26 Jul 2013 17:45:19 +0000 (17:45 +0000)]
Collapse conditional and add an assert for unhandled scope types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187224
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 26 Jul 2013 17:37:20 +0000 (17:37 +0000)]
Re-add DataLayout pointer size convenience functions.
These were reverted in r167222 along with the rest
of the last different address space pointer size attempt.
These will be used in later commits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187223
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 26 Jul 2013 17:35:47 +0000 (17:35 +0000)]
Move this to the X86 directory, unfortunately the hashes are not
endian independent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187222
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 26 Jul 2013 17:13:47 +0000 (17:13 +0000)]
Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187217
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 26 Jul 2013 17:02:41 +0000 (17:02 +0000)]
Add preliminary support for hashing DIEs and breaking them into
type units.
Initially this support is used in the computation of an ODR checker
for C++. For now we're attaching it to the DIE, but in the future
it will be attached to the type unit.
This also starts breaking out types into the separation for type
units, but without actually splitting the DIEs.
In preparation for hashing the DIEs this adds a DIEString type
that contains a StringRef with the string contained at the label.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187213
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 26 Jul 2013 17:02:36 +0000 (17:02 +0000)]
Add a way to get the context of any particular scope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187212
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 26 Jul 2013 16:54:23 +0000 (16:54 +0000)]
Remove dead or useless header checks from cmake and autoconf
On Windows, this improves clean cmake configuration time on my
workstation from 1m58s to 1m32s, which is pretty significant. There's
probably more that can be done here, but this is the low hanging fruit.
Eric volunteered to regenerate ./configure for me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187209
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jul 2013 16:21:31 +0000 (16:21 +0000)]
Extend the lifetime of the strings passed to posix_spawn_file_actions_addopen.
Thanks to Hal Finkel for finding the bug and for the initial patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187208
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jul 2013 14:55:36 +0000 (14:55 +0000)]
Improve our error handling on windows.
* Remove LLVM_ENABLE_CRT_REPORT. LLVM_DISABLE_CRASH_REPORT made it redundant.
* set Return to 1, so that we get a stack trace on failure.
* don't call _exit, so that we get a negative exit value and "not --crash"
correctly differentiates crashes and regular errors.
This is a bit experimental since the documentation on this interface is sparse.
It doesn't bring up a dialog on my windows setup, but feel free to revert
if it causes problem for your setup (and let me know what it is so that I
can try to fix this patch).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187206
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jul 2013 14:16:30 +0000 (14:16 +0000)]
Next batch of -disable-debug-info-verifier.
These tests fail without it if pipefail is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187205
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Holewinski [Fri, 26 Jul 2013 13:28:29 +0000 (13:28 +0000)]
Add a target legalize hook for SplitVectorOperand (again)
CustomLowerNode was not being called during SplitVectorOperand,
meaning custom legalization could not be used by targets.
This also adds a test case for NVPTX that depends on this custom
legalization.
Differential Revision: http://llvm-reviews.chandlerc.com/D1195
Attempt to fix the buildbots by making the X86 test I just added platform independent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187202
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jul 2013 13:18:16 +0000 (13:18 +0000)]
Revert "Add a target legalize hook for SplitVectorOperand"
This reverts commit 187198. It broke the bots.
The soft float test probably needs a -triple because of name differences.
On the hard float test I am getting a "roundss $1, %xmm0, %xmm0", instead of
"vroundss $1, %xmm0, %xmm0, %xmm0".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187201
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Holewinski [Fri, 26 Jul 2013 12:46:39 +0000 (12:46 +0000)]
Add a target legalize hook for SplitVectorOperand
CustomLowerNode was not being called during SplitVectorOperand,
meaning custom legalization could not be used by targets.
This also adds a test case for NVPTX that depends on this custom
legalization.
Differential Revision: http://llvm-reviews.chandlerc.com/D1195
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187198
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Osborne [Fri, 26 Jul 2013 10:19:02 +0000 (10:19 +0000)]
test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187195
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Osborne [Fri, 26 Jul 2013 09:50:55 +0000 (09:50 +0000)]
[XCore] Add TODO regarding byval structs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187193
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 26 Jul 2013 08:20:39 +0000 (08:20 +0000)]
Re-implement the analysis of uses in mem2reg to be significantly more
robust. It now uses an InstVisitor and worklist to actually walk the
uses of the Alloca transitively and detect the pattern which we can
directly promote: loads & stores of the whole alloca and instructions we
can completely ignore.
Also, with this new implementation teach both the predicate for testing
whether we can promote and the promotion engine itself to use the same
code so we no longer have strange divergence between the two code paths.
I've added some silly test cases to demonstrate that we can handle
slightly more degenerate code patterns now. See the below for why this
is even interesting.
Performance impact: roughly 1% regression in the performance of SROA or
ScalarRepl on a large C++-ish test case where most of the allocas are
basically ready for promotion. The reason is because of silly redundant
work that I've left FIXMEs for and which I'll address in the next
commit. I wanted to separate this commit as it changes the behavior.
Once the redundant work in removing the dead uses of the alloca is
fixed, this code appears to be faster than the old version. =]
So why is this useful? Because the previous requirement for promotion
required a *specific* visit pattern of the uses of the alloca to verify:
we *had* to look for no more than 1 intervening use. The end goal is to
have SROA automatically detect when an alloca is already promotable and
directly hand it to the mem2reg machinery rather than trying to
partition and rewrite it. This is a 25% or more performance improvement
for SROA, and a significant chunk of the delta between it and
ScalarRepl. To get there, we need to make mem2reg actually capable of
promoting allocas which *look* promotable to SROA without have SROA do
tons of work to massage the code into just the right form.
This is actually the tip of the iceberg. There are tremendous potential
savings we can realize here by de-duplicating work between mem2reg and
SROA.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187191
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 26 Jul 2013 05:39:33 +0000 (05:39 +0000)]
Add test cases for the various instruction alias and Intel syntax fixes that have gone in lately.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187188
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 26 Jul 2013 05:37:46 +0000 (05:37 +0000)]
Fix more Intel syntax issues with FP instruction aliases. Test cases coming in a subsequent patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187187
91177308-0d34-0410-b5e6-
96231b3b80d8
Tobias Grosser [Fri, 26 Jul 2013 04:16:55 +0000 (04:16 +0000)]
Make .bc en/decoding of AttrKind stable
The bitcode representation attribute kinds are encoded into / decoded from
should be independent of the current set of LLVM attributes and their position
in the AttrKind enum. This patch explicitly encodes attributes to fixed bitcode
values.
With this patch applied, LLVM does not silently misread attributes written by
LLVM 3.3. We also enhance the decoding slightly such that an error message is
printed if an unknown AttrKind encoding was dected.
Bonus: Dropping bitcode attributes from AttrKind is now easy, as old AttrKinds
do not need to be kept to support the Bitcode reader.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187186
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 26 Jul 2013 02:02:47 +0000 (02:02 +0000)]
Take advantage of the register enums being in order to remove a couple static tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187182
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Fri, 26 Jul 2013 01:35:43 +0000 (01:35 +0000)]
[PowerPC] Support powerpc64le as a syntax-checking target.
This patch provides basic support for powerpc64le as an LLVM target.
However, use of this target will not actually generate little-endian
code. Instead, use of the target will cause the correct little-endian
built-in defines to be generated, so that code that tests for
__LITTLE_ENDIAN__, for example, will be correctly parsed for
syntax-only testing. Code generation will otherwise be the same as
powerpc64 (big-endian), for now.
The patch leaves open the possibility of creating a little-endian
PowerPC64 back end, but there is no immediate intent to create such a
thing.
The LLVM portions of this patch simply add ppc64le coverage everywhere
that ppc64 coverage currently exists. There is nothing of any import
worth testing until such time as little-endian code generation is
implemented. In the corresponding Clang patch, there is a new test
case variant to ensure that correct built-in defines for little-endian
code are generated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187179
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 25 Jul 2013 23:06:39 +0000 (23:06 +0000)]
Add a bool->StringRef c'tor to StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187166
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Thu, 25 Jul 2013 22:58:31 +0000 (22:58 +0000)]
Phabricator.rst: tiny fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187164
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Thu, 25 Jul 2013 22:09:31 +0000 (22:09 +0000)]
Using a different loop induction variable than the enclosing scope. No functional changes intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187159
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Divacky [Thu, 25 Jul 2013 21:36:47 +0000 (21:36 +0000)]
PPC32 va_list is an actual structure so va_copy needs to copy the whole
structure not just a pointer. This implements that and thus fixes va_copy
on PPC32. Fixes #15286. Both bug and patch by Florian Zeitz!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187158
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Thu, 25 Jul 2013 21:19:31 +0000 (21:19 +0000)]
Debug Info: update comments and add a FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187157
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 25 Jul 2013 20:25:31 +0000 (20:25 +0000)]
Remove dead code from the makefile build system.
Back in r140220 we removed the autoconf code that would set LLVMCC_OPTION
since it was only used by the test-suite. This patch now removes code
that would only be used if LLVMCC_OPTION was set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187154
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Thu, 25 Jul 2013 19:33:30 +0000 (19:33 +0000)]
Debug Info: improve the verifier to check field types.
Make sure the context field of DIType is MDNode.
Fix testing cases to make them pass the verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187150
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 25 Jul 2013 18:58:58 +0000 (18:58 +0000)]
Remove empty directories
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187146
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 25 Jul 2013 18:55:05 +0000 (18:55 +0000)]
Remove the mblaze backend from llvm.
Approval in here http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/064169.html
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187145
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 25 Jul 2013 18:35:22 +0000 (18:35 +0000)]
RegAllocGreedy comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187141
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 25 Jul 2013 18:35:19 +0000 (18:35 +0000)]
Evict local live ranges if they can be reassigned.
The previous change to local live range allocation also suppressed
eviction of local ranges. In rare cases, this could result in more
expensive register choices. This commit actually revives a feature
that I added long ago: check if live ranges can be reassigned before
eviction. But now it only happens in rare cases of evicting a local
live range because another local live range wants a cheaper register.
The benefit is improved code size for some benchmarks on x86 and armv7.
I measured no significant compile time increase and performance
changes are noise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187140
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 25 Jul 2013 18:35:14 +0000 (18:35 +0000)]
Allocate local registers in order for optimal coloring.
Also avoid locals evicting locals just because they want a cheaper register.
Problem: MI Sched knows exactly how many registers we have and assumes
they can be colored. In cases where we have large blocks, usually from
unrolled loops, greedy coloring fails. This is a source of
"regressions" from the MI Scheduler on x86. I noticed this issue on
x86 where we have long chains of two-address defs in the same live
range. It's easy to see this in matrix multiplication benchmarks like
IRSmk and even the unit test misched-matmul.ll.
A fundamental difference between the LLVM register allocator and
conventional graph coloring is that in our model a live range can't
discover its neighbors, it can only verify its neighbors. That's why
we initially went for greedy coloring and added eviction to deal with
the hard cases. However, for singly defined and two-address live
ranges, we can optimally color without visiting neighbors simply by
processing the live ranges in instruction order.
Other beneficial side effects:
It is much easier to understand and debug regalloc for large blocks
when the live ranges are allocated in order. Yes, global allocation is
still very confusing, but it's nice to be able to comprehend what
happened locally.
Heuristics could be added to bias register assignment based on
instruction locality (think late register pairing, banks...).
Intuituvely this will make some test cases that are on the threshold
of register pressure more stable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187139
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 25 Jul 2013 18:34:24 +0000 (18:34 +0000)]
Add a way to add a kind-value string pair to an attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187138
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Thu, 25 Jul 2013 17:52:30 +0000 (17:52 +0000)]
typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187135
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 25 Jul 2013 17:16:05 +0000 (17:16 +0000)]
Current batch of -disable-debug-info-verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187130
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 25 Jul 2013 16:23:55 +0000 (16:23 +0000)]
AArch64: add llc-based tests for previous commit.
Better to have tests run even on non-AArch64 platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187128
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 25 Jul 2013 16:03:54 +0000 (16:03 +0000)]
AArch64: fix even more JIT failures
The last patch corrected some issues, but constant-pool entries had actual
codegen bugs in the large memory model (which MCJIT uses).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187126
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 25 Jul 2013 15:00:17 +0000 (15:00 +0000)]
Don't end a file name with a dot. It looks odd.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187124
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 25 Jul 2013 12:42:52 +0000 (12:42 +0000)]
AArch64: don't mask off shift bits when processing JIT relocations.
This should actually make the MCJIT tests pass again on AArch64. I don't know
how I missed their failure before.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187120
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Holewinski [Thu, 25 Jul 2013 12:32:00 +0000 (12:32 +0000)]
Fix a bug in TableGen where the intrinsic function name recognizer could mis-identify names if one was a prefix substring of the other
For two intrinsics 'llvm.nvvm.texsurf.handle' and 'llvm.nvvm.texsurf.handle.internal',
TableGen was emitting matching code like:
if (Name.startswith("llvm.nvvm.texsurf.handle")) ...
if (Name.startswith("llvm.nvvm.texsurf.handle.internal")) ...
We can never match "llvm.nvvm.texsurf.handle.internal" here because it will
always be erroneously matched by the first condition.
The fix is to sort the intrinsic names and emit them in reverse order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187119
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Thu, 25 Jul 2013 10:53:02 +0000 (10:53 +0000)]
Fix a comment cut-&-pasto.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187117
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Thu, 25 Jul 2013 09:34:38 +0000 (09:34 +0000)]
[SystemZ] Rework compare and branch support
Before the patch we took advantage of the fact that the compare and
branch are glued together in the selection DAG and fused them together
(where possible) while emitting them. This seemed to work well in practice.
However, fusing the compare so early makes it harder to remove redundant
compares in cases where CC already has a suitable value. This patch
therefore uses the peephole analyzeCompare/optimizeCompareInstr pair of
functions instead.
No behavioral change intended, but it paves the way for a later patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187116
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Thu, 25 Jul 2013 09:11:15 +0000 (09:11 +0000)]
[SystemZ] Add LOCR and LOCGR
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187113
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Thu, 25 Jul 2013 09:04:52 +0000 (09:04 +0000)]
[SystemZ] Add LOC and LOCG
As with the stores, these instructions can trap when the condition is false,
so they are only used for things like (cond ? x : *ptr).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187112
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Thu, 25 Jul 2013 08:57:02 +0000 (08:57 +0000)]
[SystemZ] Add STOC and STOCG
These instructions are allowed to trap even if the condition is false,
so for now they are only used for "*ptr = (cond ? x : *ptr)"-style
constructs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187111
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 25 Jul 2013 07:26:35 +0000 (07:26 +0000)]
MI Sched: Register pressure heuristics.
Consider which set is being increased or decreased before comparing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187110
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 25 Jul 2013 07:26:32 +0000 (07:26 +0000)]
MI Sched: track register pressure by importance of the set, not weight of the units.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187109
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 25 Jul 2013 07:26:29 +0000 (07:26 +0000)]
RegPressure: Order the "pressure sets" by number of regunits per set.
This lets heuristics easily pick the most important set to follow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187108
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 25 Jul 2013 07:26:26 +0000 (07:26 +0000)]
Dump LIS before regalloc. MI sched changes them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187107
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Thu, 25 Jul 2013 06:43:01 +0000 (06:43 +0000)]
Debug Info: improve the verifier to check field types.
Make sure the context and type fields are MDNodes. We will generate
verification errors if those fields are non-empty strings.
Fix testing cases to make them pass the verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187106
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 25 Jul 2013 03:23:25 +0000 (03:23 +0000)]
Respect llvm.used in Internalize.
The language reference says that:
"If a symbol appears in the @llvm.used list, then the compiler,
assembler, and linker are required to treat the symbol as if there is
a reference to the symbol that it cannot see"
Since even the linker cannot see the reference, we must assume that
the reference can be using the symbol table. For example, a user can add
__attribute__((used)) to a debug helper function like dump and use it from
a debugger.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187103
91177308-0d34-0410-b5e6-
96231b3b80d8