oota-llvm.git
11 years agoDocument the llvm.fabs intrinsic.
Peter Collingbourne [Tue, 3 Jul 2012 12:25:40 +0000 (12:25 +0000)]
Document the llvm.fabs intrinsic.

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

11 years agoMicro-optimize this function a bit. This shrinks the generated code
Chandler Carruth [Tue, 3 Jul 2012 07:16:13 +0000 (07:16 +0000)]
Micro-optimize this function a bit. This shrinks the generated code
some, and allows the routine to be inlined into common callers. The
various bits that hit this code in their hotpath seem slightly lower on
the profile, but I can't really measure a performance improvement as
everything seems to still be bottlenecked on likely cache misses. =/

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

11 years agoRemove extra space.
Craig Topper [Tue, 3 Jul 2012 06:48:58 +0000 (06:48 +0000)]
Remove extra space.

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

11 years agoChange i128mem/i256mem to f128mem/f256mem on some floating point vector instructions.
Craig Topper [Tue, 3 Jul 2012 06:11:06 +0000 (06:11 +0000)]
Change i128mem/i256mem to f128mem/f256mem on some floating point vector instructions.

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

11 years agoMCContext.cpp: Fixup for my odd previous commit. No functional changes.
NAKAMURA Takumi [Tue, 3 Jul 2012 06:01:27 +0000 (06:01 +0000)]
MCContext.cpp: Fixup for my odd previous commit. No functional changes.

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

11 years agoAdd aliases for pblendvb, blendvpd, and blendvps instructions with the implicit xmm0...
Craig Topper [Tue, 3 Jul 2012 05:49:45 +0000 (05:49 +0000)]
Add aliases for pblendvb, blendvpd, and blendvps instructions with the implicit xmm0 operand specified. Fixes PR13252.

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

11 years agotest/CodeGen/SPARC/private.ll: Fixup. Forgot to prune old RUN lines.
NAKAMURA Takumi [Tue, 3 Jul 2012 04:29:20 +0000 (04:29 +0000)]
test/CodeGen/SPARC/private.ll: Fixup. Forgot to prune old RUN lines.

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

11 years agotest/CodeGen/SPARC/private.ll: FileCheck-ize.
NAKAMURA Takumi [Tue, 3 Jul 2012 04:21:57 +0000 (04:21 +0000)]
test/CodeGen/SPARC/private.ll: FileCheck-ize.

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

11 years agollvm/test/lit.cfg: Retweak for Win32 to fix testing.
NAKAMURA Takumi [Tue, 3 Jul 2012 03:59:34 +0000 (03:59 +0000)]
llvm/test/lit.cfg: Retweak for Win32 to fix testing.

  - execute_external should be;
    - Not on Win32.
    - Using bash.
    In reverse, "execute_internal" shoud be (Win32 && !bash).

  - lit.getBashPath() behaves differently before and after tweaking $PATH.

I will add a few explanations there later.

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

11 years agoMCContext::GetDwarfFile(): Make FileName parsing tolerant of DOSish pathsep with...
NAKAMURA Takumi [Tue, 3 Jul 2012 03:59:29 +0000 (03:59 +0000)]
MCContext::GetDwarfFile(): Make FileName parsing tolerant of DOSish pathsep with PathV2.

It fixes failure in test/MC/MachO/gen-dwarf.s on Win32 w/o bash.

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

11 years agotest/CodeGen/X86/sincos.ll: FileCheck-ize.
NAKAMURA Takumi [Tue, 3 Jul 2012 03:59:22 +0000 (03:59 +0000)]
test/CodeGen/X86/sincos.ll: FileCheck-ize.

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

11 years agotest/CodeGen/X86/fabs.ll: FileCheck-ize.
NAKAMURA Takumi [Tue, 3 Jul 2012 03:59:15 +0000 (03:59 +0000)]
test/CodeGen/X86/fabs.ll: FileCheck-ize.

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

11 years agotest/CodeGen/X86/2007-09-05-InvalidAsm.ll: FileCheck-ize.
NAKAMURA Takumi [Tue, 3 Jul 2012 03:59:08 +0000 (03:59 +0000)]
test/CodeGen/X86/2007-09-05-InvalidAsm.ll: FileCheck-ize.

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

11 years agotest/CodeGen/X86/2004-03-30-Select-Max.ll: FileCheck-ize.
NAKAMURA Takumi [Tue, 3 Jul 2012 03:58:59 +0000 (03:58 +0000)]
test/CodeGen/X86/2004-03-30-Select-Max.ll: FileCheck-ize.

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

11 years ago mips32 long long register inline asm constraint support.
Jack Carter [Mon, 2 Jul 2012 23:35:23 +0000 (23:35 +0000)]
mips32 long long register inline asm constraint support.

    inlineasm-cnstrnt-bad-r-1.ll is NOT supposed to fail, so it was removed.    This resulted in the removal of a negative test (inlineasm-cnstrnt-bad-r-1.ll)

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

11 years agoRevert " mips32 long long register inline asm constraint support." as
Eric Christopher [Mon, 2 Jul 2012 23:22:25 +0000 (23:22 +0000)]
Revert "    mips32 long long register inline asm constraint support." as
it appears to be breaking the bots.

This reverts commit 1b055ce320fa13f6f1ac81670d11b45e01f79876.

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

11 years agoRevert "IntRange:" as it appears to be breaking self hosting.
Eric Christopher [Mon, 2 Jul 2012 23:22:21 +0000 (23:22 +0000)]
Revert "IntRange:" as it appears to be breaking self hosting.

This reverts commit b2833d9dcba88c6f0520cad760619200adc0442c.

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

11 years agodeleted test/CodeGen/Mips/inlineasm-cnstrnt-bad-r-1.ll
Jack Carter [Mon, 2 Jul 2012 23:21:22 +0000 (23:21 +0000)]
deleted test/CodeGen/Mips/inlineasm-cnstrnt-bad-r-1.ll

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

11 years agoAll glory to address sanitizer. ;]
Chandler Carruth [Mon, 2 Jul 2012 22:56:41 +0000 (22:56 +0000)]
All glory to address sanitizer. ;]

It appears to have caught a use-after-free introduced as by r159567
and/or friends which call 'addPass' from many more places. The bug in
'addPass' doesn't appear to be new, and was spotted by inspection when
ASan shown a bright light of a stacktrace at these functions.

Hopefully this will fix the ASan failure -- I have no test case other
than running an ASan-built clang over the test suite.

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

11 years agoTarget option DisableJumpTables is a gross hack. Move it to TargetLowering instead.
Evan Cheng [Mon, 2 Jul 2012 22:39:56 +0000 (22:39 +0000)]
Target option DisableJumpTables is a gross hack. Move it to TargetLowering instead.

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

11 years ago mips32 long long register inline asm constraint support.
Jack Carter [Mon, 2 Jul 2012 22:39:45 +0000 (22:39 +0000)]
mips32 long long register inline asm constraint support.

    inlineasm-cnstrnt-bad-r-1.ll is NOT supposed to fail, so it was removed.    This resulted in the removal of a negative test (inlineasm-cnstrnt-bad-r-1.ll)

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

11 years agomisched: allow NULL InstrItineraries.
Andrew Trick [Mon, 2 Jul 2012 21:55:12 +0000 (21:55 +0000)]
misched: allow NULL InstrItineraries.

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

11 years agoExtend the workaround from r159593 to cover a few explicit alias
Chandler Carruth [Mon, 2 Jul 2012 21:45:22 +0000 (21:45 +0000)]
Extend the workaround from r159593 to cover a few explicit alias
targets.

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

11 years agoRevert r159588, and apply a more principled fix. Place the fix for this
Chandler Carruth [Mon, 2 Jul 2012 21:31:03 +0000 (21:31 +0000)]
Revert r159588, and apply a more principled fix. Place the fix for this
in the abstraction for lit test suites so that the various other layers
of abstraction pick up the same behavioral fix, and so that we still get
a complete list of dependencies for the 'check-all' target.

This should fix the follow-on issues of the same nature with various
other build targets, including Clang targets. Sorry for the churn, and
again thanks to Matt for testing and breaking this more thoroughly.

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

11 years agoTurn an assert into an error to make it a bit more friendly.
Eric Christopher [Mon, 2 Jul 2012 21:16:43 +0000 (21:16 +0000)]
Turn an assert into an error to make it a bit more friendly.

Part of rdar://6880388 and rdar://11766377

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

11 years agoWork around a really frustrating apparant CMake bug.
Chandler Carruth [Mon, 2 Jul 2012 21:14:06 +0000 (21:14 +0000)]
Work around a really frustrating apparant CMake bug.

No functionality changed here, except that the CMake installed by
default on Ubuntu Lucid should actually work with the makefile
generators now.

Thanks to Matt for the report and head-desking required to figure out
why it was failing.

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

11 years agoFix -Wstring-conversion warning.
David Blaikie [Mon, 2 Jul 2012 21:00:00 +0000 (21:00 +0000)]
Fix -Wstring-conversion warning.

Patch by Matt Beaumont-Gay.

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

11 years agoRevert r159528 which taught lit's builtin shell test runner about the
Chandler Carruth [Mon, 2 Jul 2012 20:43:21 +0000 (20:43 +0000)]
Revert r159528 which taught lit's builtin shell test runner about the
'|&' bash syntax. We have lots of users with a bash on their system
which doesn't support this syntax, and as bash is still significantly
faster, we should support them.

The test suite has already been updated to cope with this.

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

11 years agoSwitch from using a lit.cfg-generator variable that happens to be found
Chandler Carruth [Mon, 2 Jul 2012 20:14:54 +0000 (20:14 +0000)]
Switch from using a lit.cfg-generator variable that happens to be found
due to strange scoping rules to the actual canonical variable name
within the LLVM CMake build.

No functionality changed.

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

11 years agoPass the correct ELFOSABI enumeration to the MipsELFObjectWriter constructor
Jack Carter [Mon, 2 Jul 2012 20:04:43 +0000 (20:04 +0000)]
Pass the correct ELFOSABI enumeration to the MipsELFObjectWriter constructor

Contributer: Sasa Stankovic

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

11 years agoExtend TargetPassConfig to allow running only a subset of the normal passes.
Bob Wilson [Mon, 2 Jul 2012 19:48:45 +0000 (19:48 +0000)]
Extend TargetPassConfig to allow running only a subset of the normal passes.

This is still a work in progress but I believe it is currently good enough
to fix PR13122 "Need unit test driver for codegen IR passes".  For example,
you can run llc with -stop-after=loop-reduce to have it dump out the IR after
running LSR.  Serializing machine-level IR is not yet supported but we have
some patches in progress for that.

The plan is to serialize the IR to a YAML file, containing separate sections
for the LLVM IR, machine-level IR, and whatever other info is needed.  Chad
suggested that we stash the stop-after pass in the YAML file and use that
instead of the start-after option to figure out where to restart the
compilation.  I think that's a great idea, but since it's not implemented yet
I put the -start-after option into this patch for testing purposes.

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

11 years agoMove assertion with TargetPassConfig's Initialized flag.
Bob Wilson [Mon, 2 Jul 2012 19:48:39 +0000 (19:48 +0000)]
Move assertion with TargetPassConfig's Initialized flag.

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

11 years agoConsistently use AnalysisID types in TargetPassConfig.
Bob Wilson [Mon, 2 Jul 2012 19:48:37 +0000 (19:48 +0000)]
Consistently use AnalysisID types in TargetPassConfig.

This makes it possible to just use a zero value to represent "no pass", so
the phony NoPassID global variable is no longer needed.

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

11 years agoAdd all codegen passes to the PassManager via TargetPassConfig.
Bob Wilson [Mon, 2 Jul 2012 19:48:31 +0000 (19:48 +0000)]
Add all codegen passes to the PassManager via TargetPassConfig.

This is a preliminary step toward having TargetPassConfig be able to
start and stop the compilation at specified passes for unit testing
and debugging.  No functionality change.

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

11 years agoAdd a missing forward declaration of PassManagerBase.
Bob Wilson [Mon, 2 Jul 2012 19:48:18 +0000 (19:48 +0000)]
Add a missing forward declaration of PassManagerBase.

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

11 years agoNeed a space.
Evan Cheng [Mon, 2 Jul 2012 19:45:42 +0000 (19:45 +0000)]
Need a space.

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

11 years agoRevert accidental checkin.
Andrew Trick [Mon, 2 Jul 2012 19:12:29 +0000 (19:12 +0000)]
Revert accidental checkin.

My last checkin was apparently not the branch I intended. It was missing one change (added by chandlerc), and contained a spurious change.

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

11 years agoFix the remaining TCL-style quotes found in the testsuite. This is
Chandler Carruth [Mon, 2 Jul 2012 19:09:46 +0000 (19:09 +0000)]
Fix the remaining TCL-style quotes found in the testsuite. This is
another mechanical change accomplished though the power of terrible Perl
scripts.

I have manually switched some "s to 's to make escaping simpler.

While I started this to fix tests that aren't run in all configurations,
the massive number of tests is due to a really frustrating fragility of
our testing infrastructure: things like 'grep -v', 'not grep', and
'expected failures' can mask broken tests all too easily.

Essentially, I'm deeply disturbed that I can change the testsuite so
radically without causing any change in results for most platforms. =/

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

11 years agoGlobalOpt forgot to handle bitcast when analyzing globals. Found by inspection.
Duncan Sands [Mon, 2 Jul 2012 18:55:39 +0000 (18:55 +0000)]
GlobalOpt forgot to handle bitcast when analyzing globals.  Found by inspection.

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

11 years agoAdded assertion in getVRegDef of MachineRegisterInfo to make sure the virtual
Manman Ren [Mon, 2 Jul 2012 18:55:36 +0000 (18:55 +0000)]
Added assertion in getVRegDef of MachineRegisterInfo to make sure the virtual
register does not have multiple definitions. Modified TwoAddressInstructionPass
to use getUniqueVRegDef instead of getVRegDef.

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

11 years agoConvert the uses of '|&' to use '2>&1 |' instead, which works on old
Chandler Carruth [Mon, 2 Jul 2012 18:37:59 +0000 (18:37 +0000)]
Convert the uses of '|&' to use '2>&1 |' instead, which works on old
versions of Bash. In addition, I can back out the change to the lit
built-in shell test runner to support this.

This should fix the majority of fallout on Darwin, but I suspect there
will be a few straggling issues.

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

11 years agoFix the C++11 build. I hate narrowing conversions.
Chandler Carruth [Mon, 2 Jul 2012 18:28:34 +0000 (18:28 +0000)]
Fix the C++11 build. I hate narrowing conversions.

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

11 years agoReapply "Make NumMicroOps a variable in the subtarget's instruction itinerary."
Andrew Trick [Mon, 2 Jul 2012 18:10:42 +0000 (18:10 +0000)]
Reapply "Make NumMicroOps a variable in the subtarget's instruction itinerary."

Reapplies r159406 with minor cleanup. The regressions appear to have been spurious.

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

11 years agoFixed switch in IntRange::isSingleNumber method.
Stepan Dyatkovskiy [Mon, 2 Jul 2012 17:42:46 +0000 (17:42 +0000)]
Fixed switch in IntRange::isSingleNumber method.

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

11 years agoDo not attempt to use ROR for Thumb1.
Bob Wilson [Mon, 2 Jul 2012 17:22:47 +0000 (17:22 +0000)]
Do not attempt to use ROR for Thumb1.
Patch by Matt Fischer!

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

11 years agofix the regression I introduced in r159385 (it's necessary to update PHI nodes in...
Nuno Lopes [Mon, 2 Jul 2012 16:14:47 +0000 (16:14 +0000)]
fix the regression I introduced in r159385 (it's necessary to update PHI nodes in unwind BB

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

11 years agoIntRange, fixed warning in isSingleNumber method
Stepan Dyatkovskiy [Mon, 2 Jul 2012 14:10:46 +0000 (14:10 +0000)]
IntRange, fixed warning in isSingleNumber method

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

11 years agoThe built-in shell test runner for some reason doesn't like the quoting
Chandler Carruth [Mon, 2 Jul 2012 13:35:01 +0000 (13:35 +0000)]
The built-in shell test runner for some reason doesn't like the quoting
and multi-line nature of this test. I don't really feel like bugging
this kind of edge-case, so just put it on one line and use single
quotes. With this, every test *really* passes with the built-in shell
test runner.

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

11 years agoFix the TCL-style quoting in one random test that somehow slipped
Chandler Carruth [Mon, 2 Jul 2012 13:29:47 +0000 (13:29 +0000)]
Fix the TCL-style quoting in one random test that somehow slipped
through my perl nets.

With this, the test suite passes even if I force it to run with the
built-in shell test logic, except for a test which REQUIREs shell.

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

11 years agoTeach the built-in shell test runner in lit to handle '|&'-style pipes.
Chandler Carruth [Mon, 2 Jul 2012 13:10:15 +0000 (13:10 +0000)]
Teach the built-in shell test runner in lit to handle '|&'-style pipes.
This is directly cloned from the logic in the TCL test bits of lit.
Hopefully will fix most of the windows build bot fallout.

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

11 years agoIntRange:
Stepan Dyatkovskiy [Mon, 2 Jul 2012 13:02:18 +0000 (13:02 +0000)]
IntRange:
  - Changed isSingleNumber method behaviour. Now this flag is calculated on demand.
IntegersSubsetMapping
  - Optimized diff operation.
  - Replaced type of Items field from std::list with std::map.
  - Added new methods:
    bool isOverlapped(self &RHS)
    void add(self& RHS, SuccessorClass *S)
    void detachCase(self& NewMapping, SuccessorClass *Succ)
    void removeCase(SuccessorClass *Succ)
    SuccessorClass *findSuccessor(const IntTy& Val)
    const IntTy* getCaseSingleNumber(SuccessorClass *Succ)
IntegersSubsetTest
  - DiffTest: Added checks for successors.
SimplifyCFG
  Updated SwitchInst usage (now it is case-ragnes compatible) for
    - SimplifyEqualityComparisonWithOnlyPredecessor
    - FoldValueComparisonIntoPredecessors

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

11 years agoConvert all tests using TCL-style quoting to use shell-style quoting.
Chandler Carruth [Mon, 2 Jul 2012 12:47:22 +0000 (12:47 +0000)]
Convert all tests using TCL-style quoting to use shell-style quoting.

This was done through the aid of a terrible Perl creation. I will not
paste any of the horrors here. Suffice to say, it require multiple
staged rounds of replacements, state carried between, and a few
nested-construct-parsing hacks that I'm not proud of. It happens, by
luck, to be able to deal with all the TCL-quoting patterns in evidence
in the LLVM test suite.

If anyone is maintaining large out-of-tree test trees, feel free to poke
me and I'll send you the steps I used to convert things, as well as
answer any painful questions etc. IRC works best for this type of thing
I find.

Once converted, switch the LLVM lit config to use ShTests the same as
Clang. In addition to being able to delete large amounts of Python code
from 'lit', this will also simplify the entire test suite and some of
lit's architecture.

Finally, the test suite runs 33% faster on Linux now. ;]
For my 16-hardware-thread (2x 4-core xeon e5520): 36s -> 24s

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

11 years agoMake tests which first provide a negative assertion via 'not', then
Chandler Carruth [Mon, 2 Jul 2012 12:23:19 +0000 (12:23 +0000)]
Make tests which first provide a negative assertion via 'not', then
a pipeline, and then a positive assertion via grep, use two RUN lines
instead.

Supporting these complex ideas of 'success' and 'failure' across
multiple stages of a pipeline is brittle in the shell world, and would
block switching to ShTest format; it only worked due to contrivances
introduced by the TclTest format.

Writing this as two separate RUN lines seems clearer in any event.

This is another step toward completely removing TclTests from lit.

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

11 years agoRewrite three tests that had truly egregious abuses of 'grep' in them to
Chandler Carruth [Mon, 2 Jul 2012 12:20:14 +0000 (12:20 +0000)]
Rewrite three tests that had truly egregious abuses of 'grep' in them to
use FileCheck.

Aside from removing a dependence on TCL-style quoting, this also makes
the tests ... significantly more robust. =] It would be really, *really*
great of the maintainer(s) of the CellSPU backend went through and
systematically rewrite these tests to use FileCheck. There are a lot
more that have nearly this bad of abuses.

Another step along the path to a TclTest-free testsuite.

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

11 years ago[asan] small code simplification
Kostya Serebryany [Mon, 2 Jul 2012 11:42:29 +0000 (11:42 +0000)]
[asan] small code simplification

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

11 years agoSwitch a bunch of Linker tests from using elaborate echo productions to
Chandler Carruth [Mon, 2 Jul 2012 10:18:06 +0000 (10:18 +0000)]
Switch a bunch of Linker tests from using elaborate echo productions to
just provide and reference separate input files from an Inputs
subdirectory. This pattern works very well in the Clang tree and is
easier to understand in my opinion. It also has fewer limitations and
will remove one particularly annoying use of TCL-style {} quoting from
the testsuite.

Also teach the LLVM lit configuration to avoid recursing into 'Inputs'
subdirectories. This wasn't required for the previous 'Inputs'
subdirectories used due to fortuitous suffix patterns.

This is the first step to completely removing support for TCL-style tests.

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

11 years agoThis patch extends the libLLVMDebugInfo which contains a minimalistic DWARF parser:
Alexey Samsonov [Mon, 2 Jul 2012 05:54:45 +0000 (05:54 +0000)]
This patch extends the libLLVMDebugInfo which contains a minimalistic DWARF parser:
1) DIContext is now able to return function name for a given instruction address (besides file/line info).
2) llvm-dwarfdump accepts flag --functions that prints the function name (if address is specified by --address flag).
3) test case that checks the basic functionality of llvm-dwarfdump added

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

11 years agoNow that RegistersDefinedFromSameValue handles one instruction being an
Rafael Espindola [Sun, 1 Jul 2012 17:08:01 +0000 (17:08 +0000)]
Now that RegistersDefinedFromSameValue handles one instruction being an
implicit_def, the other instruction can be anything, including instructions
that define multiple values. Be careful about that and don't assume what operand
0 is.
Fixes pr13249.

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

11 years agoOptimization of shuffle node that can fit to the register form of VBROADCAST instruct...
Elena Demikhovsky [Sun, 1 Jul 2012 06:12:26 +0000 (06:12 +0000)]
Optimization of shuffle node that can fit to the register form of VBROADCAST instruction on AVX2.

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

11 years agoReduce code size by using a second switch statement to avoid extra calls to SelectAto...
Craig Topper [Sun, 1 Jul 2012 02:55:34 +0000 (02:55 +0000)]
Reduce code size by using a second switch statement to avoid extra calls to SelectAtomic64. Also catch cases where SelectAtomic64 fails.

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

11 years agoAdd a break to the end of case statement missed in r159501.
Craig Topper [Sun, 1 Jul 2012 02:18:18 +0000 (02:18 +0000)]
Add a break to the end of case statement missed in r159501.

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

11 years agoFix a crash on release builds if gather intrinsics are passed a non-constant value...
Craig Topper [Sun, 1 Jul 2012 02:17:08 +0000 (02:17 +0000)]
Fix a crash on release builds if gather intrinsics are passed a non-constant value for the last argument.

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

11 years agoUse a second switch statement to reduce number of calls to SelectGather in code....
Craig Topper [Sun, 1 Jul 2012 02:05:52 +0000 (02:05 +0000)]
Use a second switch statement to reduce number of calls to SelectGather in code. Reduces code size a bit.

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

11 years agoReduce use list thrashing by using DenseMap's find_as for maps with ValueHandle keys.
Benjamin Kramer [Sat, 30 Jun 2012 22:37:15 +0000 (22:37 +0000)]
Reduce use list thrashing by using DenseMap's find_as for maps with ValueHandle keys.

No functionality change.

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

11 years agoDon't reinsert the 'atexit' function if it already exists.
Bill Wendling [Sat, 30 Jun 2012 20:21:19 +0000 (20:21 +0000)]
Don't reinsert the 'atexit' function if it already exists.

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

11 years agoHoist LLVM's lit testsuite infrastructure into module so that it can be
Chandler Carruth [Sat, 30 Jun 2012 10:14:14 +0000 (10:14 +0000)]
Hoist LLVM's lit testsuite infrastructure into module so that it can be
re-used. Also, build in direct support for accumulating a set of lit
parameters, arguments, and testsuites to run as part of a 'check-all'
rule. This sinks 'check-all' from a Clang-specific construct to
a generic construct of the project.

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

11 years agoAvoid sign compare warning.
Benjamin Kramer [Sat, 30 Jun 2012 10:02:08 +0000 (10:02 +0000)]
Avoid sign compare warning.

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

11 years agoHandle implicit_defs in the register coalescer. I am still trying to produce
Rafael Espindola [Sat, 30 Jun 2012 01:45:55 +0000 (01:45 +0000)]
Handle implicit_defs in the register coalescer. I am still trying to produce
a reduced testcase, but this fixes pr13209.

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

11 years agorevert r159440. As Duncan pointed out, the test for invoke is not needed at this...
Nuno Lopes [Fri, 29 Jun 2012 22:10:10 +0000 (22:10 +0000)]
revert r159440. As Duncan pointed out, the test for invoke is not needed at this point

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

11 years agoARM: Clean up optimizeCompare in peephole, no functional change.
Manman Ren [Fri, 29 Jun 2012 22:06:19 +0000 (22:06 +0000)]
ARM: Clean up optimizeCompare in peephole, no functional change.

Use getUniqueVRegDef.
Replace a loop with existing interfaces: modifiesRegister and readsRegister.
Factor out code into inline functions and simplify the code.

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

11 years agoAdd SrcReg2 to analyzeCompare and optimizeCompareInstr to handle Compare
Manman Ren [Fri, 29 Jun 2012 21:33:59 +0000 (21:33 +0000)]
Add SrcReg2 to analyzeCompare and optimizeCompareInstr to handle Compare
instructions with two register operands.

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

11 years agoClear kill flags in InstrEmitter::EmitSubregNode().
Jakob Stoklund Olesen [Fri, 29 Jun 2012 21:00:03 +0000 (21:00 +0000)]
Clear kill flags in InstrEmitter::EmitSubregNode().

When a local virtual register is made global, make sure to clear any
existing kill flags.

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

11 years agoCheck for extra kill flags on live-out virtual registers.
Jakob Stoklund Olesen [Fri, 29 Jun 2012 21:00:00 +0000 (21:00 +0000)]
Check for extra kill flags on live-out virtual registers.

This would previously get reported as the misleading "Virtual register
def doesn't dominate all uses."

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

11 years agoCodeGenPrepare: Don't crash when TLI is not available.
Benjamin Kramer [Fri, 29 Jun 2012 19:58:21 +0000 (19:58 +0000)]
CodeGenPrepare: Don't crash when TLI is not available.

This happens when codegenprepare is invoked via opt.

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

11 years agoAdd getUniqueVRegDef to MachineRegisterInfo.
Manman Ren [Fri, 29 Jun 2012 19:16:05 +0000 (19:16 +0000)]
Add getUniqueVRegDef to MachineRegisterInfo.
This comes in handy during peephole optimization.

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

11 years agoRework this to clarify where the removal of nodes from the queue is
Duncan Sands [Fri, 29 Jun 2012 19:03:05 +0000 (19:03 +0000)]
Rework this to clarify where the removal of nodes from the queue is
really happening.  No intended functionality change.

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

11 years agoRefreshCallGraph: ignore 'invoke intrinsic'. IntrinsicInst doesnt not recognize invok...
Nuno Lopes [Fri, 29 Jun 2012 17:49:32 +0000 (17:49 +0000)]
RefreshCallGraph: ignore 'invoke intrinsic'. IntrinsicInst doesnt not recognize invoke, and shouldnt at this point, since the rest of LLVM codebase doesnt expect invoke of intrinsics

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

11 years agoignore 'invoke new' in isInstructionTriviallyDead, since most callers are not ready...
Nuno Lopes [Fri, 29 Jun 2012 17:37:07 +0000 (17:37 +0000)]
ignore 'invoke new' in isInstructionTriviallyDead, since most callers are not ready to handle invokes. instcombine will take care of this.

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

11 years agoCleanup in DwarfDebug - fix a typo and remove two unused functions
Alexey Samsonov [Fri, 29 Jun 2012 16:04:14 +0000 (16:04 +0000)]
Cleanup in DwarfDebug - fix a typo and remove two unused functions

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

11 years agoFix a reassociate crash on sozefx when compiling with dragonegg+gcc-4.7 due to
Duncan Sands [Fri, 29 Jun 2012 13:25:06 +0000 (13:25 +0000)]
Fix a reassociate crash on sozefx when compiling with dragonegg+gcc-4.7 due to
the optimizers producing a multiply expression with more multiplications than
the original (!).

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

11 years agoMove llvm/Support/IRBuilder.h -> llvm/IRBuilder.h
Chandler Carruth [Fri, 29 Jun 2012 12:38:19 +0000 (12:38 +0000)]
Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.h

This was always part of the VMCore library out of necessity -- it deals
entirely in the IR. The .cpp file in fact was already part of the VMCore
library. This is just a mechanical move.

I've tried to go through and re-apply the coding standard's preferred
header sort, but at 40-ish files, I may have gotten some wrong. Please
let me know if so.

I'll be committing the corresponding updates to Clang and Polly, and
Duncan has DragonEgg.

Thanks to Bill and Eric for giving the green light for this bit of cleanup.

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

11 years agoUpdate the CMake files.
Bill Wendling [Fri, 29 Jun 2012 09:01:47 +0000 (09:01 +0000)]
Update the CMake files.

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

11 years agoSphinxify the Atomics documentation.
Bill Wendling [Fri, 29 Jun 2012 09:00:01 +0000 (09:00 +0000)]
Sphinxify the Atomics documentation.

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

11 years agoThe DIBuilder class is just a wrapper around debug info creation
Bill Wendling [Fri, 29 Jun 2012 08:32:07 +0000 (08:32 +0000)]
The DIBuilder class is just a wrapper around debug info creation
(a.k.a. MDNodes). The module doesn't belong in Analysis. Move it to the VMCore
instead.

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

11 years agoRevert "Make NumMicroOps a variable in the subtarget's instruction itinerary."
Andrew Trick [Fri, 29 Jun 2012 07:10:41 +0000 (07:10 +0000)]
Revert "Make NumMicroOps a variable in the subtarget's instruction itinerary."

This reverts commit r159406. I noticed a performance regression so I'll back out for now.

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

11 years agoIn the initial exec mode we always do a load to find the address of a variable.
Rafael Espindola [Fri, 29 Jun 2012 04:22:35 +0000 (04:22 +0000)]
In the initial exec mode we always do a load to find the address of a variable.
Before this patch in pic 32 bit code we would add the global base register
and not load from that address. This is a really old bug, but before the
introduction of the tls attributes we would never select initial exec for
pic code.

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

11 years agomisched: avoid scheduling instructions that can't be dispatched.
Andrew Trick [Fri, 29 Jun 2012 03:23:24 +0000 (03:23 +0000)]
misched: avoid scheduling instructions that can't be dispatched.

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

11 years agomisched: count micro-ops toward the issue limit.
Andrew Trick [Fri, 29 Jun 2012 03:23:22 +0000 (03:23 +0000)]
misched: count micro-ops toward the issue limit.

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

11 years agoMake NumMicroOps a variable in the subtarget's instruction itinerary.
Andrew Trick [Fri, 29 Jun 2012 03:23:18 +0000 (03:23 +0000)]
Make NumMicroOps a variable in the subtarget's instruction itinerary.

The TargetInstrInfo::getNumMicroOps API does not change, but soon it
will be used by MachineScheduler. Now each subtarget can specify the
number of micro-ops per itinerary class. For ARM, this is currently
always dynamic (-1), because it is used for load/store multiple which
depends on the number of register operands.

Zero is now a valid number of micro-ops. This can be used for
nop pseudo-instructions or instructions that the hardware can squash
during dispatch.

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

11 years agoX86: add more GATHER intrinsics in LLVM
Manman Ren [Fri, 29 Jun 2012 00:54:20 +0000 (00:54 +0000)]
X86: add more GATHER intrinsics in LLVM

Corrected type for index of llvm.x86.avx2.gather.d.pd.256
  from 256-bit to 128-bit.
Corrected types for src|dst|mask of llvm.x86.avx2.gather.q.ps.256
  from 256-bit to 128-bit.

Support the following intrinsics:
  llvm.x86.avx2.gather.d.q, llvm.x86.avx2.gather.q.q
  llvm.x86.avx2.gather.d.q.256, llvm.x86.avx2.gather.q.q.256
  llvm.x86.avx2.gather.d.d, llvm.x86.avx2.gather.q.d
  llvm.x86.avx2.gather.d.d.256, llvm.x86.avx2.gather.q.d.256

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

11 years agoRemove a completely unnecessary mkdir from the CMake build.
Chandler Carruth [Fri, 29 Jun 2012 00:45:57 +0000 (00:45 +0000)]
Remove a completely unnecessary mkdir from the CMake build.

Clang has been getting along fine without this for quite some time.

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

11 years agoAdd a missing common variable to the lit.site.cfg generation. This was
Chandler Carruth [Fri, 29 Jun 2012 00:40:15 +0000 (00:40 +0000)]
Add a missing common variable to the lit.site.cfg generation. This was
only used in the Clang tree, but it seems reasonable to support.

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

11 years agoIf the step value is a constant zero, the loop isn't going to terminate. Fixes
Nick Lewycky [Thu, 28 Jun 2012 23:44:57 +0000 (23:44 +0000)]
If the step value is a constant zero, the loop isn't going to terminate. Fixes
the assert reported in PR13228!

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

11 years agomake the verifier accept @llvm.donothing as the only intrinsic that can be invoked
Nuno Lopes [Thu, 28 Jun 2012 22:57:00 +0000 (22:57 +0000)]
make the verifier accept @llvm.donothing as the only intrinsic that can be invoked
While at it, merge 2 tests and FileCheckize them

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

11 years agomake simplifyCFG erase invokes to readonly/readnone functions
Nuno Lopes [Thu, 28 Jun 2012 22:32:27 +0000 (22:32 +0000)]
make simplifyCFG erase invokes to readonly/readnone functions

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

11 years agomake instcombine produce calls to llvm.donothing instead of a random intrinsic
Nuno Lopes [Thu, 28 Jun 2012 22:31:24 +0000 (22:31 +0000)]
make instcombine produce calls to llvm.donothing instead of a random intrinsic

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

11 years agoadd a new @llvm.donothing intrinsic that, well, does nothing, and teach CodeGen to...
Nuno Lopes [Thu, 28 Jun 2012 22:30:12 +0000 (22:30 +0000)]
add a new @llvm.donothing intrinsic that, well, does nothing, and teach CodeGen to ignore calls to it

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

11 years ago'Promote' vector [su]int_to_fp should widen elements.
Jim Grosbach [Thu, 28 Jun 2012 21:03:44 +0000 (21:03 +0000)]
'Promote' vector [su]int_to_fp should widen elements.

Teach vector legalization how to honor Promote for int to float
conversions. The code checking whether to promote the operation knew
to look at the operand, but the actual promotion code didn't. This
fixes that. The operand is promoted up via [zs]ext.

rdar://11762659

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

11 years agoChanged the formatting sequence of a curly brace to
Jack Carter [Thu, 28 Jun 2012 20:46:26 +0000 (20:46 +0000)]
Changed the formatting sequence of a curly brace to
the comment per code review feedback.

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

11 years agoRegenerate.
Eric Christopher [Thu, 28 Jun 2012 20:35:00 +0000 (20:35 +0000)]
Regenerate.

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