Akira Hatanaka [Wed, 4 Apr 2012 18:22:53 +0000 (18:22 +0000)]
Fix LowerBlockAddress to produce instructions with the correct relocation
types for N32 ABI and update test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154031
91177308-0d34-0410-b5e6-
96231b3b80d8
Hongbin Zheng [Wed, 4 Apr 2012 13:24:40 +0000 (13:24 +0000)]
Add testcase for r154007, when a function has the optsize attribute,
the loop should be unrolled according the value of OptSizeUnrollThreshold.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154014
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 4 Apr 2012 12:51:34 +0000 (12:51 +0000)]
Always compute all the bits in ComputeMaskedBits.
This allows us to keep passing reduced masks to SimplifyDemandedBits, but
know about all the bits if SimplifyDemandedBits fails. This allows instcombine
to simplify cases like the one in the included testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154011
91177308-0d34-0410-b5e6-
96231b3b80d8
Hongbin Zheng [Wed, 4 Apr 2012 11:44:08 +0000 (11:44 +0000)]
LoopUnrollPass: Use variable "Threshold" instead of "CurrentThreshold" when
reducing unroll count, otherwise the reduced unroll count is not taking
the "OptimizeForSize" attribute into account.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154007
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 4 Apr 2012 08:53:34 +0000 (08:53 +0000)]
Move yaml::Stream's dtor out of line so it can see Scanner's dtor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154004
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 4 Apr 2012 08:24:08 +0000 (08:24 +0000)]
Implement DwarfLLVMRegPair::operator< without violating asymmetry.
MSVC8 verifies this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154002
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 4 Apr 2012 04:55:46 +0000 (04:55 +0000)]
Convert assert(false) followed by a return to llvm_unreachable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153997
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 4 Apr 2012 04:42:42 +0000 (04:42 +0000)]
Remove default case from switch that was already covering all cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153996
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Wed, 4 Apr 2012 00:53:04 +0000 (00:53 +0000)]
Removed useless switch for default case when switch was covering all the enum values
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153984
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Tue, 3 Apr 2012 23:44:39 +0000 (23:44 +0000)]
Fix the install location for the Embedded makefile target.
svn r145378 inadvertently changed the destination for the Embedded target
in the makefile. Add a "/Developer" suffix to DSTROOT to compensate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153980
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Tue, 3 Apr 2012 23:36:44 +0000 (23:36 +0000)]
Sorry about that. MSVC seems to accept just about any random string you give it ;/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153979
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Tue, 3 Apr 2012 23:13:26 +0000 (23:13 +0000)]
Remove dead code for installing libLTO when building llvmCore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153978
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Tue, 3 Apr 2012 23:09:22 +0000 (23:09 +0000)]
Add YAML parser to Support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153977
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Tue, 3 Apr 2012 22:57:55 +0000 (22:57 +0000)]
Add VSELECT to LegalizeVectorTypes::ScalariseVectorResult. Previously it would crash if it encountered a 1 element VSELECT. Solution is slightly more complicated than just creating a SELET as we have to mask or sign extend the vector condition if it had different boolean contents from the scalar condition. Fixes <rdar://problem/
11178095>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153976
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Tue, 3 Apr 2012 22:18:49 +0000 (22:18 +0000)]
Removed one last bad continue statement meant to be removed in r153914.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153975
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Tue, 3 Apr 2012 21:50:26 +0000 (21:50 +0000)]
When building llvmCore, pass the SDKROOT and -arch setting to configure.
So far all of configure tests have been run against the default SDK and
architecture, regardless of what is actually being built. We've gotten
lucky until now. <rdar://problem/
11112479>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153972
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Tue, 3 Apr 2012 21:50:24 +0000 (21:50 +0000)]
Remove a reference to the C backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153971
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 3 Apr 2012 20:11:24 +0000 (20:11 +0000)]
Fix an issue in SimplifySetCC() specific to vector comparisons.
When folding X == X we need to check getBooleanContents() to determine if the
result is a vector of ones or a vector of negative ones.
I tried creating a test case, but the problem seems to only be exposed on a
much older version of clang (around r144500).
rdar://
10923049
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153966
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Tue, 3 Apr 2012 19:48:31 +0000 (19:48 +0000)]
Set soname for FreeBSD as well.
Patch by Bernard Cafarelli!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153965
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 3 Apr 2012 17:55:42 +0000 (17:55 +0000)]
Fix thinko check for number of operands to be the one that actually
might have more than 19 operands. Add a testcase to make sure I
never screw that up again.
Part of rdar://
11026482
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153961
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Tue, 3 Apr 2012 16:27:16 +0000 (16:27 +0000)]
Matrix simplification in PBQP may push infinite costs onto register options.
The colorability heuristic should count these as denied registers.
No test case - this exposed a bug on an out-of-tree target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153958
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Tue, 3 Apr 2012 15:48:14 +0000 (15:48 +0000)]
ARMDisassembler: drop bogus dependency on ARMCodeGen
And indirectly, a dependency on most of the core LLVM optimization
libraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153957
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Tue, 3 Apr 2012 15:48:10 +0000 (15:48 +0000)]
Object: drop bogus VMCore dependency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153956
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Tue, 3 Apr 2012 11:19:21 +0000 (11:19 +0000)]
The speedup doesn't appear to have been from this, but was an anomaly of my testing machine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153951
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Tue, 3 Apr 2012 10:50:09 +0000 (10:50 +0000)]
Reserve space for the eventual filling of the vector. This gives a small speedup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153949
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Tue, 3 Apr 2012 07:39:36 +0000 (07:39 +0000)]
Add an additional testcase which checks ops with multiple users.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153939
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Tue, 3 Apr 2012 06:59:28 +0000 (06:59 +0000)]
Make PPCCompilationCallbackC function to be static, so there will be no need to issue call via
PLT when LLVM is built as shared library. This mimics the X86 backend towards the approach.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153938
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 3 Apr 2012 06:52:47 +0000 (06:52 +0000)]
Tidy up spacing in some tablegen outputs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153937
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 3 Apr 2012 05:20:24 +0000 (05:20 +0000)]
Add support for AVX enhanced comparison predicates. Patch from Kay Tiong Khoo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153935
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Tue, 3 Apr 2012 03:56:52 +0000 (03:56 +0000)]
Reformatting. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153928
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Tue, 3 Apr 2012 03:27:43 +0000 (03:27 +0000)]
As Eric pointed out, even a Debug build should be equal. Leave the flag that can turn off comparisons though.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153927
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 3 Apr 2012 03:01:13 +0000 (03:01 +0000)]
Revert r153924. Delete test/MC/Disassembler/Mips and lib/Target/Mips/Disassembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153926
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 3 Apr 2012 02:51:09 +0000 (02:51 +0000)]
Revert r153924. There were buildbot failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153925
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 3 Apr 2012 02:20:58 +0000 (02:20 +0000)]
MIPS disassembler support.
Patch by Vladimir Medic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153924
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 3 Apr 2012 01:35:52 +0000 (01:35 +0000)]
Cleanup set_union usage. The same thing but a bit cleaner now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153922
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 3 Apr 2012 00:47:23 +0000 (00:47 +0000)]
Use std::set_union instead of nasty custom code.
I just noticed Jakob's examples of the proper application of
std::set... routines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153918
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 3 Apr 2012 00:43:49 +0000 (00:43 +0000)]
Add a line number for the scope of the function (starting at the first
brace) so that we get more accurate line number information about the
declaration of a given function and the line where the function
first starts.
Part of rdar://
11026482
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153916
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Tue, 3 Apr 2012 00:28:46 +0000 (00:28 +0000)]
Fixes to r153903. Added missing explanation of behaviour when the VirtRegMap is NULL. Also changed it in this case to just avoid updating the map, but live ranges or intervals will still get updated and created
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153914
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Mon, 2 Apr 2012 23:27:43 +0000 (23:27 +0000)]
Compare the .o files only for release builds. Add an option to bypass the comparison altogether.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153909
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Mon, 2 Apr 2012 22:44:18 +0000 (22:44 +0000)]
Moved LiveRangeEdit.h so that it can be called from other parts of the backend, not just libCodeGen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153906
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 2 Apr 2012 22:37:54 +0000 (22:37 +0000)]
Make dominatedBySlowTreeWalk private and assert cases handled by the caller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153905
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Mon, 2 Apr 2012 22:30:39 +0000 (22:30 +0000)]
Allocate virtual registers in ascending order.
This is just the fallback tie-breaker ordering, the main allocation
order is still descending size.
Patch by Shamil Kurmangaleev!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153904
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Mon, 2 Apr 2012 22:22:53 +0000 (22:22 +0000)]
Refactored the LiveRangeEdit interface so that MachineFunction, TargetInstrInfo, MachineRegisterInfo, LiveIntervals, and VirtRegMap are all passed into the constructor and stored as members instead of passed in to each method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153903
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Mon, 2 Apr 2012 22:16:50 +0000 (22:16 +0000)]
Add an option to turn off the expensive GVN load PRE part of GVN.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153902
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 2 Apr 2012 22:10:29 +0000 (22:10 +0000)]
Add predicates for checking whether targets have free FNEG and FABS operations, and prevent the DAGCombiner from turning them into bitwise operations if they do.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153901
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 2 Apr 2012 19:58:43 +0000 (19:58 +0000)]
During two-address lowering, rescheduling an instruction does not untie
operands. Make TryInstructionTransform return false to reflect this.
Fixes PR11861.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153892
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 2 Apr 2012 19:44:20 +0000 (19:44 +0000)]
No need to run llvm-as.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153890
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Mon, 2 Apr 2012 19:25:22 +0000 (19:25 +0000)]
Initial 64 bit direct object support.
This patch allows llvm to recognize that a 64 bit object file is being produced
and that the subsequently generated ELF header has the correct information.
The test case checks for both big and little endian flavors.
Patch by Jack Carter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153889
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Mon, 2 Apr 2012 19:09:04 +0000 (19:09 +0000)]
The binutils for the IBM BG/P are too old to support CFI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153886
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Mon, 2 Apr 2012 18:31:33 +0000 (18:31 +0000)]
Add triple support for the IBM BG/P and BG/Q supercomputers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153882
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 2 Apr 2012 17:58:52 +0000 (17:58 +0000)]
Turn on the accelerator tables for Darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153880
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Mon, 2 Apr 2012 17:16:45 +0000 (17:16 +0000)]
Fast fix for PR12343:
http://llvm.org/bugs/show_bug.cgi?id=12343
We have not trivial way for splitting edges that are goes from indirect branch. We can do it with some tricks, but it should be additionally discussed. And it is still dangerous due to difficulty of indirect branches controlling.
Fix forbids this case for unswitching.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153879
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Divacky [Mon, 2 Apr 2012 15:49:30 +0000 (15:49 +0000)]
Implement the SVR4 byval alignment for aggregates. Fixing a FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153876
91177308-0d34-0410-b5e6-
96231b3b80d8
Silviu Baranga [Mon, 2 Apr 2012 15:46:46 +0000 (15:46 +0000)]
Second part for the 153874 one
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153875
91177308-0d34-0410-b5e6-
96231b3b80d8
Silviu Baranga [Mon, 2 Apr 2012 15:20:39 +0000 (15:20 +0000)]
Added fix in TableGen instruction decoder generation. The decoder now breaks for every leaf node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153874
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 2 Apr 2012 13:02:57 +0000 (13:02 +0000)]
Add missing 'd'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153872
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Mon, 2 Apr 2012 10:01:21 +0000 (10:01 +0000)]
Hack the hack. If we have a situation where an ASM object is defined but isn't
reflected in the LLVM IR (as a declare or something), then treat it like a data
object.
N.B. This isn't 100% correct. The ASM parser should supply more information so
that we know what type of object it is, and what attributes it should have.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153870
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 2 Apr 2012 09:13:46 +0000 (09:13 +0000)]
Emit the asm writer's mnemonic table with SequenceToOffsetTable.
This way we can get AVX v-prefixed instructions tail merged with the normal insns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153869
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 2 Apr 2012 08:32:38 +0000 (08:32 +0000)]
Move getOpcodeName from the various target InstPrinters into the superclass MCInstPrinter.
All implementations used the same code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153866
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 2 Apr 2012 07:48:39 +0000 (07:48 +0000)]
Reorder fields in MatchEntry and OperandMatchEntry to reduce padding. A bit tricky due to the target specific sizes for some of the fields so the ordering is only optimal for the targets in the tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153865
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Mon, 2 Apr 2012 07:11:12 +0000 (07:11 +0000)]
Optimizing swizzles of complex shuffles may generate additional complex shuffles.
Do not try to optimize swizzles of shuffles if the source shuffle has more than
a single user, except when the source shuffle is also a swizzle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153864
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 2 Apr 2012 07:01:04 +0000 (07:01 +0000)]
Remove getInstructionName from MCInstPrinter implementations in favor of using the instruction name table from MCInstrInfo. Reduces static data in the InstPrinter implementations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153863
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 2 Apr 2012 06:54:01 +0000 (06:54 +0000)]
Fix CXXFLAGS for huge_val.m4.
Patch by Jeremy Huddleston!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153862
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 2 Apr 2012 06:09:36 +0000 (06:09 +0000)]
Make MCInstrInfo available to the MCInstPrinter. This will be used to remove getInstructionName and the static data it contains since the same tables are already in MCInstrInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153860
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Mon, 2 Apr 2012 03:33:31 +0000 (03:33 +0000)]
It could come about that we parse the inline ASM before we get a potential
definition for it. In that case, we want to wait for the potential definition
before we create a symbol for it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153859
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 2 Apr 2012 00:47:39 +0000 (00:47 +0000)]
Use SequenceToOffsetTable to generate instruction name table for AsmWriter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153857
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sun, 1 Apr 2012 22:44:09 +0000 (22:44 +0000)]
Start cleaning up the InlineCost class. This switches to sentinel values
rather than a bitfield, a great suggestion by Chris during code review.
There is still quite a bit of cruft in the interface, but that requires
sorting out some awkward uses of the cost inside the actual inliner.
No functionality changed intended here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153853
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sun, 1 Apr 2012 21:20:14 +0000 (21:20 +0000)]
Fix some 80-col. violations I introduced with the A2 PPC64 core.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153852
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sun, 1 Apr 2012 20:08:17 +0000 (20:08 +0000)]
Enable prefetch generation on PPC64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153851
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sun, 1 Apr 2012 20:08:08 +0000 (20:08 +0000)]
Add LdStSTD* itin. for the PPC64 A2 core.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153850
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Sun, 1 Apr 2012 19:31:22 +0000 (19:31 +0000)]
This commit contains a few changes that had to go in together.
1. Simplify xor/and/or (bitcast(A), bitcast(B)) -> bitcast(op (A,B))
(and also scalar_to_vector).
2. Xor/and/or are indifferent to the swizzle operation (shuffle of one src).
Simplify xor/and/or (shuff(A), shuff(B)) -> shuff(op (A, B))
3. Optimize swizzles of shuffles: shuff(shuff(x, y), undef) -> shuff(x, y).
4. Fix an X86ISelLowering optimization which was very bitcast-sensitive.
Code which was previously compiled to this:
movd (%rsi), %xmm0
movdqa .LCPI0_0(%rip), %xmm2
pshufb %xmm2, %xmm0
movd (%rdi), %xmm1
pshufb %xmm2, %xmm1
pxor %xmm0, %xmm1
pshufb .LCPI0_1(%rip), %xmm1
movd %xmm1, (%rdi)
ret
Now compiles to this:
movl (%rsi), %eax
xorl %eax, (%rdi)
ret
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153848
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Sun, 1 Apr 2012 19:27:25 +0000 (19:27 +0000)]
Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153846
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sun, 1 Apr 2012 19:23:08 +0000 (19:23 +0000)]
Set the default PPC node scheduling preference to ILP (for the embedded cores).
The 440 and A2 cores have detailed itineraries, and this allows them to be
fully used to maximize throughput.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153845
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sun, 1 Apr 2012 19:23:04 +0000 (19:23 +0000)]
Add ppc440 itin. entries for LdStSTD*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153844
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sun, 1 Apr 2012 19:22:57 +0000 (19:22 +0000)]
Use full anti-dep. breaking with post-ra sched. on the embedded ppc cores.
Post-RA scheduling gives a significant performance improvement on
the embedded cores, so turn it on. Using full anti-dep. breaking is
important for FP-intensive blocks, so turn it on (just on the
embedded cores for now; this should also be good on the 970s because
post-ra scheduling is all that we have for now, but that should have
more testing first).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153843
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sun, 1 Apr 2012 19:22:40 +0000 (19:22 +0000)]
Add instruction itinerary for the PPC64 A2 core.
This adds a full itinerary for IBM's PPC64 A2 embedded core. These
cores form the basis for the CPUs in the new IBM BG/Q supercomputer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153842
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 1 Apr 2012 18:14:14 +0000 (18:14 +0000)]
Use SequenceToOffsetTable to create instruction name table. Saves space particularly on X86 where AVX instructions just add a 'v' to the front of other instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153841
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 1 Apr 2012 14:23:58 +0000 (14:23 +0000)]
Emit the LLVM<->DWARF register mapping as a sorted table and use binary search to do the lookup.
This also avoids emitting the information twice, which led to code bloat. On i386-linux-Release+Asserts
with all targets built this change shaves a whopping 1.3 MB off clang. The number is probably exaggerated
by recent inliner changes but the methods were already enormous with the old inline cost computation.
The DWARF reg -> LLVM reg mapping doesn't seem to have holes in it, so it could be a simple lookup table.
I didn't implement that optimization yet to avoid potentially changing functionality.
There is still some duplication both in tablegen and the generated code that should be cleaned up eventually.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153837
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sun, 1 Apr 2012 10:41:24 +0000 (10:41 +0000)]
Belatedly address some code review from Chris.
As a side note, I really dislike array_pod_sort... Do we really still
care about any STL implementations that get this so wrong? Does libc++?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153834
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sun, 1 Apr 2012 10:36:17 +0000 (10:36 +0000)]
Add some more testing to cover the remaining two cases where
always-inlining is disabled: recursive functions and indirectbr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153833
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sun, 1 Apr 2012 10:21:05 +0000 (10:21 +0000)]
Fix a pretty scary bug I introduced into the always inliner with
a single missing character. Somehow, this had gone untested. I've added
tests for returns-twice logic specifically with the always-inliner that
would have caught this, and fixed the bug.
Thanks to Matt for the careful review and spotting this!!! =D
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153832
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sun, 1 Apr 2012 10:11:17 +0000 (10:11 +0000)]
Replace four tiny tests with various uses of grep and not with a single
test and FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153831
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Sun, 1 Apr 2012 07:24:23 +0000 (07:24 +0000)]
misched: Add finalizeScheduler to complete the target interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153827
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Bendersky [Sun, 1 Apr 2012 06:50:01 +0000 (06:50 +0000)]
Removing a file that's no longer being used after the recent refactorings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153825
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sun, 1 Apr 2012 04:44:16 +0000 (04:44 +0000)]
Split the LdStGeneral PPC itin. class into LdStLoad and LdStStore.
Loads and stores can have different pipeline behavior, especially on
embedded chips. This change allows those differences to be expressed.
Except for the 440 scheduler, there are no functionality changes.
On the 440, the latency adjustment is only by one cycle, and so this
probably does not affect much. Nevertheless, it will make a larger
difference in the future and this removes a FIXME from the 440 itin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153821
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sat, 31 Mar 2012 21:54:20 +0000 (21:54 +0000)]
Add a workaround for building with old versions of clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153820
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sat, 31 Mar 2012 18:59:07 +0000 (18:59 +0000)]
Add a triple to the test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153818
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sat, 31 Mar 2012 18:14:00 +0000 (18:14 +0000)]
Teach CodeGen's version of computeMaskedBits to understand the range metadata.
This is the CodeGen equivalent of r153747. I tested that there is not noticeable
performance difference with any combination of -O0/-O2 /-g when compiling
gcc as a single compilation unit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153817
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sat, 31 Mar 2012 14:45:15 +0000 (14:45 +0000)]
Fix dynamic linking on PPC64.
Dynamic linking on PPC64 has had problems since we had to move the top-down
hazard-detection logic post-ra. For dynamic linking to work there needs to be
a nop placed after every call. It turns out that it is really hard to guarantee
that nothing will be placed in between the call (bl) and the nop during post-ra
scheduling. Previous attempts at fixing this by placing logic inside the
hazard detector only partially worked.
This is now fixed in a different way: call+nop codegen-only instructions. As far
as CodeGen is concerned the pair is now a single instruction and cannot be split.
This solution works much better than previous attempts.
The scoreboard hazard detector is also renamed to be more generic, there is currently
no cpu-specific logic in it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153816
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 31 Mar 2012 13:18:09 +0000 (13:18 +0000)]
Fix a typo reported in IRC by someone reviewing this code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153815
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 31 Mar 2012 13:17:18 +0000 (13:17 +0000)]
Give the always-inliner its own custom filter. It shouldn't have to pay
the very high overhead of the complex inline cost analysis when all it
wants to do is detect three patterns which must not be inlined. Comment
the code, clean it up, and leave some hints about possible performance
improvements if this ever shows up on a profile.
Moving this off of the (now more expensive) inline cost analysis is
particularly important because we have to run this inliner even at -O0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153814
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 31 Mar 2012 12:48:08 +0000 (12:48 +0000)]
Remove a bunch of empty, dead, and no-op methods from all of these
interfaces. These methods were used in the old inline cost system where
there was a persistent cache that had to be updated, invalidated, and
cleared. We're now doing more direct computations that don't require
this intricate dance. Even if we resume some level of caching, it would
almost certainly have a simpler and more narrow interface than this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153813
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 31 Mar 2012 12:42:41 +0000 (12:42 +0000)]
Initial commit for the rewrite of the inline cost analysis to operate
on a per-callsite walk of the called function's instructions, in
breadth-first order over the potentially reachable set of basic blocks.
This is a major shift in how inline cost analysis works to improve the
accuracy and rationality of inlining decisions. A brief outline of the
algorithm this moves to:
- Build a simplification mapping based on the callsite arguments to the
function arguments.
- Push the entry block onto a worklist of potentially-live basic blocks.
- Pop the first block off of the *front* of the worklist (for
breadth-first ordering) and walk its instructions using a custom
InstVisitor.
- For each instruction's operands, re-map them based on the
simplification mappings available for the given callsite.
- Compute any simplification possible of the instruction after
re-mapping, and store that back int othe simplification mapping.
- Compute any bonuses, costs, or other impacts of the instruction on the
cost metric.
- When the terminator is reached, replace any conditional value in the
terminator with any simplifications from the mapping we have, and add
any successors which are not proven to be dead from these
simplifications to the worklist.
- Pop the next block off of the front of the worklist, and repeat.
- As soon as the cost of inlining exceeds the threshold for the
callsite, stop analyzing the function in order to bound cost.
The primary goal of this algorithm is to perfectly handle dead code
paths. We do not want any code in trivially dead code paths to impact
inlining decisions. The previous metric was *extremely* flawed here, and
would always subtract the average cost of two successors of
a conditional branch when it was proven to become an unconditional
branch at the callsite. There was no handling of wildly different costs
between the two successors, which would cause inlining when the path
actually taken was too large, and no inlining when the path actually
taken was trivially simple. There was also no handling of the code
*path*, only the immediate successors. These problems vanish completely
now. See the added regression tests for the shiny new features -- we
skip recursive function calls, SROA-killing instructions, and high cost
complex CFG structures when dead at the callsite being analyzed.
Switching to this algorithm required refactoring the inline cost
interface to accept the actual threshold rather than simply returning
a single cost. The resulting interface is pretty bad, and I'm planning
to do lots of interface cleanup after this patch.
Several other refactorings fell out of this, but I've tried to minimize
them for this patch. =/ There is still more cleanup that can be done
here. Please point out anything that you see in review.
I've worked really hard to try to mirror at least the spirit of all of
the previous heuristics in the new model. It's not clear that they are
all correct any more, but I wanted to minimize the change in this single
patch, it's already a bit ridiculous. One heuristic that is *not* yet
mirrored is to allow inlining of functions with a dynamic alloca *if*
the caller has a dynamic alloca. I will add this back, but I think the
most reasonable way requires changes to the inliner itself rather than
just the cost metric, and so I've deferred this for a subsequent patch.
The test case is XFAIL-ed until then.
As mentioned in the review mail, this seems to make Clang run about 1%
to 2% faster in -O0, but makes its binary size grow by just under 4%.
I've looked into the 4% growth, and it can be fixed, but requires
changes to other parts of the inliner.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153812
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 31 Mar 2012 11:31:24 +0000 (11:31 +0000)]
Add support to the InstVisitor for visiting a generic callsite. The
visitor will now visit a CallInst and an InvokeInst with
instruction-specific visitors, then visit a generic CallSite visitor,
then delegate back to the Instruction visitor and the TerminatorInst
visitors depending on whether a call or an invoke originally. This will
be used in the soon-to-land inline cost rewrite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153811
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sat, 31 Mar 2012 11:25:18 +0000 (11:25 +0000)]
Move trivial functions into the class definition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153810
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sat, 31 Mar 2012 11:22:30 +0000 (11:22 +0000)]
Trim headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153809
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sat, 31 Mar 2012 11:15:43 +0000 (11:15 +0000)]
Indent according to LLVM's style guide.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153808
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sat, 31 Mar 2012 11:10:35 +0000 (11:10 +0000)]
Cleanup whitespace and trim some of the #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153807
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 31 Mar 2012 11:03:47 +0000 (11:03 +0000)]
Internalize: Remove reference of @llvm.noinline, it was replaced with the noinline attribute a long time ago.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153806
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sat, 31 Mar 2012 10:51:45 +0000 (10:51 +0000)]
These strings aren't 'const char *' but 'char *'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153805
91177308-0d34-0410-b5e6-
96231b3b80d8