Rafael Espindola [Mon, 27 Aug 2012 03:03:07 +0000 (03:03 +0000)]
Pass -lLTO after gold-plugin.o so that it gets used in systems that default to
--as-needed.
Patch by Felix Geyer. Fixes pr13262.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162652
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 26 Aug 2012 22:01:42 +0000 (22:01 +0000)]
Mark avx2 maskstore has ReadWriteArgMem. Mark broadcast and maskload as ReadArgMem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162649
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 24 Aug 2012 23:29:28 +0000 (23:29 +0000)]
Fix integer undefined behavior due to signed left shift overflow in LLVM.
Reviewed offline by chandlerc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162623
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 24 Aug 2012 23:29:07 +0000 (23:29 +0000)]
Add missing mayLoad flags to a large class of AVX *_Int instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162622
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 24 Aug 2012 22:46:55 +0000 (22:46 +0000)]
Missed tLEApcrelJT.
ARMConstantIslandPass expects this instruction to stay in the same basic
block as the jump table branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162615
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 24 Aug 2012 22:46:53 +0000 (22:46 +0000)]
Infer instruction properties from single-instruction patterns.
Previously, instructions without a primary patterns wouldn't get their
properties inferred. Now, we use all single-instruction patterns for
inference, including 'def : Pat<>' instances.
This causes a lot of instruction flags to change.
- Many instructions no longer have the UnmodeledSideEffects flag because
their flags are now inferred from a pattern.
- Instructions with intrinsics will get a mayStore flag if they already
have UnmodeledSideEffects and a mayLoad flag if they already have
mayStore. This is because intrinsics properties are linear.
- Instructions with atomic_load patterns get a mayStore flag because
atomic loads can't be reordered. The correct workaround is to create
pseudo-instructions instead of using normal loads. PR13693.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162614
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 24 Aug 2012 21:44:11 +0000 (21:44 +0000)]
Explicitly mark LEApcrel pseudos with hasSideEffects.
It's not clear that they should be marked as such, but tbb formation
fails if t2LEApcrelJT is hoisted of of a loop.
This doesn't change the flags on these instructions,
UnmodeledSideEffects was already inferred from the missing pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162603
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 24 Aug 2012 21:08:09 +0000 (21:08 +0000)]
Stop inferring isVariadic from instruction patterns.
Instructions are now only marked as variadic if they use variable_ops in
their ins list.
A variadic SDNode is typically used for call nodes that have the call
arguments as operands.
A variadic MachineInstr can actually encode a variable number of
operands, for example ARM's stm/ldm instructions. A call instruction
does not have to be variadic. The call argument registers are added as
implicit operands.
This change remove the MCID::Variadic flags from most call and return
instructions, allowing us to better verify their operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162599
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 24 Aug 2012 20:52:46 +0000 (20:52 +0000)]
Fix call instruction operands in ARMFastISel.
The ARM BL and BLX instructions don't have predicate operands, but the
thumb variants tBL and tBLX do.
The argument registers should be added as implicit uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162593
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 24 Aug 2012 20:52:44 +0000 (20:52 +0000)]
Mark X86::RET and RETI instructions as variadic.
There is special magic happening when returning floating point values on
the x87 stack. The RET instructions get extra f80 operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162592
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 24 Aug 2012 20:52:42 +0000 (20:52 +0000)]
Avoid including explicit uses when counting SDNode imp-uses.
It is legal to have a register node as an explicit operand, it shouldn't
be counted as an implicit use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162591
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 24 Aug 2012 20:40:15 +0000 (20:40 +0000)]
Disable Mips' delay slot filler when optimization level is O0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162589
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 24 Aug 2012 20:21:49 +0000 (20:21 +0000)]
In MipsDAGToDAGISel::SelectAddr, fold add node into address operand, if its
second operand is MipsISD::GPRel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162584
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Fri, 24 Aug 2012 18:40:00 +0000 (18:40 +0000)]
Forgot to check in ProfileDataTypes.h in r162576
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162578
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Fri, 24 Aug 2012 18:31:44 +0000 (18:31 +0000)]
Profile: move a single enum out of ProfileInfoTypes.h into a new
ProfileDataTypes.h header.
With this patch the old and new profiling code can exist side-by-side. The new
profiling code will be submitted soon and it only supports insert-edge-profiling
for now and will not depend on ProfileInfo.
Patch by Alastair Murray.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162576
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Fri, 24 Aug 2012 18:14:27 +0000 (18:14 +0000)]
BranchProb: modify the definition of an edge in BranchProbabilityInfo to handle
the case of multiple edges from one block to another.
A simple example is a switch statement with multiple values to the same
destination. The definition of an edge is modified from a pair of blocks to
a pair of PredBlock and an index into the successors.
Also set the weight correctly when building SelectionDAG from LLVM IR,
especially when converting a Switch.
IntegersSubsetMapping is updated to calculate the weight for each cluster.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162572
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 24 Aug 2012 17:08:41 +0000 (17:08 +0000)]
Verify explicit instruction properties when they can be inferred.
It is now allowed to explicitly set hasSideEffects, mayStore, and
mayLoad on instructions with patterns.
Verify that the patterns are consistent with the explicit flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162569
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 24 Aug 2012 16:44:47 +0000 (16:44 +0000)]
[asan/tsan] rename FunctionBlackList* to BlackList* as this class is not limited to functions any more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162566
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 24 Aug 2012 16:40:11 +0000 (16:40 +0000)]
[asan/tsan] extend the functionality of FunctionBlackList to globals and modules. Patch by Reid Watson.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162565
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Divacky [Fri, 24 Aug 2012 16:26:02 +0000 (16:26 +0000)]
Lower constant pools and jump tables via TOC on PPC64/SVR4.
In collaboration with Adhemerval Zanella.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162562
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 24 Aug 2012 15:06:28 +0000 (15:06 +0000)]
GVN: Fix quadratic runtime on the number of switch cases.
No intended behavior change. This was introduced in r162023. With the fixed
algorithm a Release build of ARMInstPrinter.cpp goes from 16s to 10s on a
2011 MBP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162559
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 24 Aug 2012 14:43:30 +0000 (14:43 +0000)]
Fix load/store SDNode flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162558
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 24 Aug 2012 14:43:27 +0000 (14:43 +0000)]
Add missing SDNPSideEffect flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162557
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 24 Aug 2012 14:43:22 +0000 (14:43 +0000)]
Remove more mayLoad workarounds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162556
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 24 Aug 2012 09:53:43 +0000 (09:53 +0000)]
Try to appease MSVC even more elaborately in the alignment hacking space.
MSVC doesn't support passing by-value parameters with alignment of
16-bytes or higher apparantly. What is deeply confusing is that it seems
to *sometimes* (but not always) apply this to any type whose alignment
is set using __declspec(align(...)). This caused lots of errors when we switch
SmallVector over to use the automatically aligned character array
utilities as they used __declspec(align(...)) heavily.
As a pretty horrible but effective work-around, we instead cherry pick
the smallest alignment sizes with specific types that happen to have the
correct alignment, and then fall back to the attribute solution past
them. This should resolve the MSVC build errors folks have been hitting.
Sorry for that. In good news, it will do this without introducing other
UB I hope. =]
Thanks to Timur Iskhodzhanov for helping me test this!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162549
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 24 Aug 2012 04:03:22 +0000 (04:03 +0000)]
Custom lower FMA intrinsics to target specific nodes and remove the patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162534
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 24 Aug 2012 01:14:27 +0000 (01:14 +0000)]
Use DW_FORM_flag_present to save space in debug information if we're
not in darwin gdb compat mode.
Fixes rdar://
10975088
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162526
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 24 Aug 2012 01:14:23 +0000 (01:14 +0000)]
Add support for some missing DW_FORM_*.
TODO: Fix code duplication and coding style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162525
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 24 Aug 2012 01:14:21 +0000 (01:14 +0000)]
Formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162524
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 24 Aug 2012 00:35:46 +0000 (00:35 +0000)]
Fix undefined behavior (negation of INT_MIN) in ARM backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162520
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 24 Aug 2012 00:31:45 +0000 (00:31 +0000)]
Fix floating-point divide by zero, in a case where the value was not going to be used anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162518
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 24 Aug 2012 00:31:20 +0000 (00:31 +0000)]
Remove some spurious mayLoad = 0 flags.
They were inserted to silence TableGen's warning about
redundant properties. That warning is now gone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162517
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 24 Aug 2012 00:31:16 +0000 (00:31 +0000)]
Heed guessInstructionProperties, and stop warning on redundant flags.
Emit TableGen errors if guessInstructionProperties is 0 and
instruction properties can't be inferred from patterns.
Allow explicit instruction properties even when they can be inferred.
This patch doesn't change the TableGen output. Redundant properties
are not yet verified because the tree has errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162516
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 24 Aug 2012 00:31:13 +0000 (00:31 +0000)]
Add missing SDNP properties on the flushw node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162515
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 24 Aug 2012 00:31:10 +0000 (00:31 +0000)]
X86MemBarrier has unmodeled side effects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162514
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 24 Aug 2012 00:01:19 +0000 (00:01 +0000)]
Fix undefined behavior (signed integer overflow) when Clang parses a hexfloat with an enormous exponent. Caught by an existing unit test + -ftrapv.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162505
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 23 Aug 2012 23:26:57 +0000 (23:26 +0000)]
Formatting cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162499
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 23 Aug 2012 23:21:11 +0000 (23:21 +0000)]
Add an assert here in case parsing gave us a NULL compile unit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162498
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 23 Aug 2012 22:52:55 +0000 (22:52 +0000)]
Remove the DW_AT_MIPS_linkage name attribute when we don't need it
output (we're emitting a specification already and the information
isn't changing) and we're not in old gdb compat mode.
Saves 1% on the debug information for a build of llvm.
Fixes rdar://
11043421
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162493
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 23 Aug 2012 22:36:40 +0000 (22:36 +0000)]
Turn these two options in to trinary state so that they can be
turned on and off separate from the platform if you're on darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162487
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 23 Aug 2012 22:36:36 +0000 (22:36 +0000)]
Add a flag to DwarfDebug to allow it to communicate whether or not
we're using the darwin old gdb compat mode for emitting dwarf.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162486
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 23 Aug 2012 22:36:31 +0000 (22:36 +0000)]
Preserve operand flags in convertToThreeAddress() by copying operands.
No test case, this is a generalization of r160260.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162485
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 23 Aug 2012 19:34:46 +0000 (19:34 +0000)]
Tristate mayLoad, mayStore, and hasSideEffects.
Keep track of the set/unset state of these bits along with their
true/false values, but treat '?' as '0' for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162461
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 23 Aug 2012 19:34:41 +0000 (19:34 +0000)]
Add CodeGenTarget::guessInstructionProperties.
Currently, TableGen just guesses instruction properties when it can't
infer them form patterns.
This adds a guessInstructionProperties flag to the instruction set
definition that will be used to disable guessing. The flag is intended
as a migration aid. It will be removed again when no more targets need
their properties guessed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162460
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 23 Aug 2012 19:21:38 +0000 (19:21 +0000)]
Fix attributes on X86 store intrinsics.
These intrinsics don't have unmodeled side effects, they are just
stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162459
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Thu, 23 Aug 2012 19:06:23 +0000 (19:06 +0000)]
Fix a stub signature. HeuristicReduce should return a bool.
This should fix a -Wdocumentation warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162458
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 23 Aug 2012 18:14:30 +0000 (18:14 +0000)]
Favor FMA3 over FMA4 if both are enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162454
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Thu, 23 Aug 2012 16:54:08 +0000 (16:54 +0000)]
Fix a bunch of -Wdocumentation warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162446
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 23 Aug 2012 07:32:06 +0000 (07:32 +0000)]
Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162438
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 23 Aug 2012 07:32:02 +0000 (07:32 +0000)]
Only emit the __debug_inlined section if we're trying to be compatible
with older gdbs on darwin.
rdar://
10975874
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162436
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 23 Aug 2012 07:18:46 +0000 (07:18 +0000)]
Make this darwin specific to try to silence the bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162435
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 23 Aug 2012 07:10:56 +0000 (07:10 +0000)]
Emit pubtypes only when going for darwin gdb compatibility.
rdar://
10393214
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162434
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 23 Aug 2012 07:10:51 +0000 (07:10 +0000)]
Filecheck-ize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162433
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 23 Aug 2012 07:10:46 +0000 (07:10 +0000)]
Add an option for darwin gdb compatibility.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162432
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Thu, 23 Aug 2012 07:00:48 +0000 (07:00 +0000)]
Make the setInst method take its MCInst parameter by reference, a la Jim's
change in r162404.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162431
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 23 Aug 2012 04:57:36 +0000 (04:57 +0000)]
Use a switch statement instead of a bunch of if-else checks and pull out the common function call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162428
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 23 Aug 2012 04:45:31 +0000 (04:45 +0000)]
Remove unused private field to silence build warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162426
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 23 Aug 2012 00:52:51 +0000 (00:52 +0000)]
80-col.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162422
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 23 Aug 2012 00:52:49 +0000 (00:52 +0000)]
Tidy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162421
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 23 Aug 2012 00:39:43 +0000 (00:39 +0000)]
Simplify the computeOperandLatency API.
The logic for recomputing latency based on a ScheduleDAG edge was
shady. This bypasses the problem by requiring the client to provide
operand indices. This ensures consistent use of the machine model's
API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162420
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Thu, 23 Aug 2012 00:21:05 +0000 (00:21 +0000)]
Make function loadImmediate a member of MipsSEInstrInfo and change it to return
the temporary register that was used to load the immediate. Currently, it always
returns register $at, but this will change if, in the future, we decide to use
another register.
No changes in functionality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162417
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Wed, 22 Aug 2012 23:58:53 +0000 (23:58 +0000)]
Add a member of type Mips16InstrInfo/MipsSEInstrInfo to class
Mips16RegisterInfo/MipsSERegisterInfo.
No changes in functionality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162413
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 22 Aug 2012 23:49:16 +0000 (23:49 +0000)]
Fix an assortment of doxygen comment mistakes found by -Wdocumentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162411
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 22 Aug 2012 23:33:58 +0000 (23:33 +0000)]
Print out the location of expanded multiclass defs in TableGen errors.
When reporting an error for a defm, we would previously only report the
location of the outer defm, which is not always where the error is.
Now we also print the location of the expanded multiclass defs:
lib/Target/X86/X86InstrSSE.td:2902:12: error: foo
defm ADD : basic_sse12_fp_binop_s<0x58, "add", fadd, SSE_ALU_ITINS_S>,
^
lib/Target/X86/X86InstrSSE.td:2801:11: note: instantiated from multiclass
defm PD : sse12_fp_packed<opc, !strconcat(OpcodeStr, "pd"), OpNode, VR128,
^
lib/Target/X86/X86InstrSSE.td:194:5: note: instantiated from multiclass
def rm : PI<opc, MRMSrcMem, (outs RC:$dst), (ins RC:$src1, x86memop:$src2),
^
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162409
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Wed, 22 Aug 2012 22:19:40 +0000 (22:19 +0000)]
MCInstFragment constructor should take by-reference MCInst.
The MCInst is immediately passed to the copy-constructor for local
storage, so there's no need for the parameter itself to be by-value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162404
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Wed, 22 Aug 2012 22:01:01 +0000 (22:01 +0000)]
darwin/cross-build: Unset SDKROOT when building BuildTools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162402
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 22 Aug 2012 19:39:15 +0000 (19:39 +0000)]
SimplifyLibCalls: Give all safely-shrinkable libcalls the same treatment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162383
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 22 Aug 2012 19:14:29 +0000 (19:14 +0000)]
[ms-inline asm] Avoid a false positive assertion
Assertion failed: (Start.isValid() == End.isValid() && "Start and end should
either both be valid or both be invalid!")
when parsing inline asm. SMLoc assumes that the first char * in the source is
invalid. However, when parsing an inline asm the mnemonic is at this location.
I don't want to change SMLoc, so use a trivial workaround.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162381
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 22 Aug 2012 17:34:11 +0000 (17:34 +0000)]
Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162370
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 22 Aug 2012 17:31:04 +0000 (17:31 +0000)]
Add test case for r162368.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162369
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 22 Aug 2012 17:22:33 +0000 (17:22 +0000)]
Add a few float shrinking optimizations to SimplifyLibCalls. Unsafe
optimizations are guarded by the -enable-double-float-shrink LLVM option.
Last bit of PR13574. Patch by Weiming Zhao <weimingz@codeaurora.org>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162368
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 22 Aug 2012 17:18:53 +0000 (17:18 +0000)]
Tidy up a few more uses of MF.getFunction()->getName().
Based on CR feedback from r162301 and Craig Topper's refactoring in r162347
here are a few other places that could use the same API (& in one instance drop
a Function.h dependency).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162367
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 22 Aug 2012 16:52:57 +0000 (16:52 +0000)]
Add a new helper function, AddOpt(F1, F1, Opt), as part of PR13574. No
functional change intended. Patch by Weiming Zhao <weimingz@codeaurora.org>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162363
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 22 Aug 2012 15:37:57 +0000 (15:37 +0000)]
Reduce duplicated hash map lookups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162362
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Wed, 22 Aug 2012 09:33:55 +0000 (09:33 +0000)]
Rejected 169195. As Duncan commented, bitcasting to proper type is wrong approach. We need to insert some valid TRANCATE node here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162354
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 22 Aug 2012 06:07:19 +0000 (06:07 +0000)]
Add a getName function to MachineFunction. Use it in places that previously did getFunction()->getName(). Remove includes of Function.h that are no longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162347
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 22 Aug 2012 05:59:59 +0000 (05:59 +0000)]
Don't cache the MBB in the class. Its only used by one function. Change a for loop over operands to use unsigned instead of int.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162344
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 22 Aug 2012 05:36:44 +0000 (05:36 +0000)]
Mark a function as static since it doesn't use anything in the class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162342
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Wed, 22 Aug 2012 03:18:13 +0000 (03:18 +0000)]
Add register Mips::GP to the list of reserved registers if target is bare-metal
to prevent it from being clobbered. mips uses $gp to access small data section.
This bug was originally reported by Carl Norum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162340
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Wed, 22 Aug 2012 02:51:28 +0000 (02:51 +0000)]
Add option disable-mips-delay-filler. Turn on mips' delay slot filler by
default.
Patch by Carl Norum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162339
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Wed, 22 Aug 2012 01:06:23 +0000 (01:06 +0000)]
TblGen: Make asm-matcher ConvertToMCInst() table driven.
No change in interface or functionality. Purely under-the-hood
details of the generated function that change.
The X86 assembly parser is reduced in size by over 15% and ARM by
over 10%.
No performance change by my measurements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162337
91177308-0d34-0410-b5e6-
96231b3b80d8
Jack Carter [Wed, 22 Aug 2012 00:49:30 +0000 (00:49 +0000)]
For mips64 switch statements in subroutines could generate
within the codegen EK_GPRel64BlockAddress. This was not
supported for direct object output and resulted in an assertion.
This change adds support for EK_GPRel64BlockAddress for
direct object.
One fallout from this is to turn on rela relocations
for mips64 to match gas.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162334
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Wed, 22 Aug 2012 00:42:39 +0000 (00:42 +0000)]
Initialize SelectionDAGBuilder's Context in 'init', not in its constructor. The
SelectionDAG's 'init' has not been called when the SelectionDAGBuilder is
constructed (in SelectionDAGISel's constructor), so this was previously always
initialized with 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162333
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Wed, 22 Aug 2012 00:11:07 +0000 (00:11 +0000)]
Reduce alignment of SmallVector<T> to the required amount, rather than forcing 16-byte alignment. This fixes misaligned SmallVector accesses via ExtractValueInst's SmallVector data member.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162331
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 21 Aug 2012 23:28:56 +0000 (23:28 +0000)]
Add a few functions to TargetLibraryInfo as part of PR13574.
Patch by Weiming Zhao <weimingz@codeaurora.org>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162329
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 21 Aug 2012 21:03:40 +0000 (21:03 +0000)]
MaximumSpanningTree::EdgeWeightCompare: Make this comparator actually be a
strict weak ordering, and don't pass possibly-null pointers to dyn_cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162314
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 21 Aug 2012 20:52:03 +0000 (20:52 +0000)]
Fix misaligned access in MachO object file reader: despite containing an
int64_t, Symbol64TableEntry is actually only stored with 4-byte alignment
within the file.
The usage of #pragma pack here is copied from the corresponding code in
Support/Endian.h, so shouldn't introduce any new portability problems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162312
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 21 Aug 2012 20:48:36 +0000 (20:48 +0000)]
Fix unaligned memory accesses when performing relocations in X86 JIT. There's
no cost to using memcpy here: the fixed code is optimized by LLVM to perfect
machine code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162311
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 21 Aug 2012 20:39:25 +0000 (20:39 +0000)]
Don't pass a null pointer to cast<> in its unit tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162310
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 21 Aug 2012 20:35:14 +0000 (20:35 +0000)]
Don't bind a reference to a dereferenced null pointer (for return value of WeakVH::operator*).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162309
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 21 Aug 2012 19:36:59 +0000 (19:36 +0000)]
[ms-inline asm] Do not report a Parser error when matching inline assembly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162306
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 21 Aug 2012 19:23:30 +0000 (19:23 +0000)]
Ignore the documentation-suggested location for compile_commands.json
According to http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html
it's suggested that compile_commands.json in the root of the LLVM source tree
should be a symlink to the json file produced by your build system of choice.
So here's a patch so it doesn't turn up in git status, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162305
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 21 Aug 2012 19:13:12 +0000 (19:13 +0000)]
The presence of the empty file "foo" unfortunately does not improve LLVM in any way.
Thanks to Duncan Sands for catching this random file in code review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162304
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 21 Aug 2012 18:54:23 +0000 (18:54 +0000)]
Remove unnecessary cast that was also unnecessarily casting away constness.
Even looking at the revision history I couldn't quite piece together why this
cast was ever written in the first place, but I assume it was because of some
change in the inheritance, perhaps this function was reimplemented in a
derived type & this caller was meant to get the base version (& it wasn't
virtual)?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162301
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 21 Aug 2012 18:54:21 +0000 (18:54 +0000)]
Provide a portability macro for __builtin_trap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162300
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Aug 2012 18:29:30 +0000 (18:29 +0000)]
Fix macros arguments with an underscore, dot or dollar in them. This is based
on a patch by Andy/PaX. I added the support for dot and dollar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162298
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 21 Aug 2012 18:14:59 +0000 (18:14 +0000)]
[ms-inline asm] Expose the ErrorInfo from the MatchInstructionImpl. In general,
this is the index of the operand that failed to match.
Note: This may cause a buildbot failure due to an API mismatch in clang. Should
recover with my next commit to clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162295
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 21 Aug 2012 17:22:47 +0000 (17:22 +0000)]
Formatting. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162292
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Aug 2012 17:12:05 +0000 (17:12 +0000)]
Make the wording in of the "expected identifier" error in the .macro directive
consistent with the other "expected identifier" errors.
Extracted from the Andy/PaX patch. I added the test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162291
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Tue, 21 Aug 2012 16:20:37 +0000 (16:20 +0000)]
Pacify PVS-Studio by changing the type rather than doing a cast, a tweak
suggested by David Blaikie.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162286
91177308-0d34-0410-b5e6-
96231b3b80d8