Lang Hames [Wed, 11 Mar 2015 00:43:26 +0000 (00:43 +0000)]
[Orc][MCJIT][RuntimeDyld] Re-apply r231726 and r231724 with fix suggested by
Dave Blaikie. Thanks Dave!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231896
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 11 Mar 2015 00:19:01 +0000 (00:19 +0000)]
Fix a grammar issue I introduced.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231894
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 11 Mar 2015 00:15:44 +0000 (00:15 +0000)]
Inspired by r231891, use gender neutral pronouns in the places I've
found in LLVM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231893
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Tue, 10 Mar 2015 23:55:38 +0000 (23:55 +0000)]
Fix Value dangling reference debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231889
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 10 Mar 2015 23:46:01 +0000 (23:46 +0000)]
Have TargetRegisterInfo::getLargestLegalSuperClass take a
MachineFunction argument so that it can look up the subtarget
rather than using a cached one in some Targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231888
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 10 Mar 2015 23:45:55 +0000 (23:45 +0000)]
Remove subtarget dependence from HexagonRegisterInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231887
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 10 Mar 2015 23:44:12 +0000 (23:44 +0000)]
Split test in two to handle building without x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231886
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 10 Mar 2015 23:22:04 +0000 (23:22 +0000)]
Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231883
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 10 Mar 2015 23:06:32 +0000 (23:06 +0000)]
Add missing section symbol to COFF's .debug_types.dwo.
Should bring the cygwin bots back.
I added a triple to the test that was failing so that it would have failed
on Linux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231882
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Tue, 10 Mar 2015 22:52:37 +0000 (22:52 +0000)]
If a conditional branch jumps to the same target, remove the condition
Given that large parts of inst combine is restricted to instructions which have one use, getting rid of a use on the condition can help the effectiveness of the optimizer. Also, it allows the condition to potentially be deleted by instcombine rather than waiting for another pass.
I noticed this completely by accident in another test case. It's not anything that actually came from a real workload.
p.s. We should probably do the same thing for switch instructions.
Differential Revision: http://reviews.llvm.org/D8220
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231881
91177308-0d34-0410-b5e6-
96231b3b80d8
Paul Robinson [Tue, 10 Mar 2015 22:44:45 +0000 (22:44 +0000)]
Emit correct linkage-name attribute based on DWARF version.
There are still 4 tests that check for DW_AT_MIPS_linkage_name,
because they specify DWARF 2 or 3 in the module metadata. So, I didn't
create an explicit version-based test for the attribute.
Differential Revision: http://reviews.llvm.org/D8227
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231880
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Tue, 10 Mar 2015 22:43:20 +0000 (22:43 +0000)]
Infer known bits from dominating conditions
This patch adds limited support in ValueTracking for inferring known bits of a value from conditional expressions which must be true to reach the instruction we're trying to optimize. At this time, the feature is off by default. Once landed, I'm hoping for feedback from others on both profitability and compile time impact.
Forms of conditional value propagation have been tried in LLVM before and have failed due to compile time problems. In an attempt to side step that, this patch only considers conditions where the edge leaving the branch dominates the context instruction. It does not attempt full dataflow. Even with that restriction, it handles many interesting cases:
* Early exits from functions
* Early exits from loops (for context instructions in the loop and after the check)
* Conditions which control entry into loops, including multi-version loops (such as those produced during vectorization, IRCE, loop unswitch, etc..)
Possible applications include optimizing using information provided by constructs such as: preconditions, assumptions, null checks, & range checks.
This patch implements two approaches to the problem that need further benchmarking. Approach 1 is to directly walk the dominator tree looking for interesting conditions. Approach 2 is to inspect other uses of the value being queried for interesting comparisons. From initial benchmarking, it appears that Approach 2 is faster than Approach 1, but this needs to be further validated.
Differential Revision: http://reviews.llvm.org/D7708
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231879
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 10 Mar 2015 22:03:14 +0000 (22:03 +0000)]
Remove the use of the subtarget in MCCodeEmitter creation and
update all ports accordingly. Required a couple of small rewrites
in handling subtarget features during creation in PPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231861
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 10 Mar 2015 22:00:25 +0000 (22:00 +0000)]
Create symbols marking the start of a section earlier.
This lets us pass the symbol to the constructor and avoid the mutable field.
This also opens the way for outputting the symbol only when needed, instead
of outputting them at the start of the file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231859
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 10 Mar 2015 21:57:34 +0000 (21:57 +0000)]
Remove createAMDGPUMCCodeEmitter and instead just register the correct
MCCodeEmitter creation routine based on TargetMachine since the only
64-bit R600 gpus are part of the GCN target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231856
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Tue, 10 Mar 2015 21:48:15 +0000 (21:48 +0000)]
[CodeGenPrepare] Refine the cost model provided by the promotion helper.
- Use TargetLowering to check for the actual cost of each extension.
- Provide a factorized method to check for the cost of an extension:
TargetLowering::isExtFree.
- Provide a virtual method TargetLowering::isExtFreeImpl for targets to be able
to tune the cost of non-free extensions.
This refactoring offers a better granularity to model what really happens on
different targets.
No performance changes and very few code differences.
Part of <rdar://problem/
19267165>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231855
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Tue, 10 Mar 2015 21:47:39 +0000 (21:47 +0000)]
[LoopAccesses] Add debug message to indicate the result of the analysis
The debug message was pretty confusing here. It only reported the
situation with memchecks without the result of the dependence analysis.
Now it prints whether the loop is safe from the POV of the dependence
analysis and if yes, whether we need memchecks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231854
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 10 Mar 2015 21:35:16 +0000 (21:35 +0000)]
Move a non-trivial virtual function out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231853
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Tue, 10 Mar 2015 21:24:13 +0000 (21:24 +0000)]
[Hexagon] Adding frame index + add load/store patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231850
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 10 Mar 2015 21:16:18 +0000 (21:16 +0000)]
clang-format code that is about to change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231848
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Tue, 10 Mar 2015 21:12:32 +0000 (21:12 +0000)]
[Hexagon] Simplifying deallocret definitions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231847
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 10 Mar 2015 21:05:09 +0000 (21:05 +0000)]
clang-format these declarations. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231846
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 10 Mar 2015 21:01:50 +0000 (21:01 +0000)]
Don't repeat names in comments. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231845
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Tue, 10 Mar 2015 20:56:22 +0000 (20:56 +0000)]
[Hexagon] Separating InstHexagon from OpcodeHexagon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231844
91177308-0d34-0410-b5e6-
96231b3b80d8
Nemanja Ivanovic [Tue, 10 Mar 2015 20:51:07 +0000 (20:51 +0000)]
Add support for part-word atomics for PPC
http://reviews.llvm.org/D8090#inline-67337
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231843
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Tue, 10 Mar 2015 20:48:02 +0000 (20:48 +0000)]
Add new LLVM_OPTIMIZED_TABLEGEN build setting which configures, builds and uses a release tablegen build when LLVM is configured with assertions enabled.
Summary: This change leverages the cross-compiling functionality in the build system to build a release tablegen executable for use during the build.
Reviewers: resistor, rnk
Reviewed By: rnk
Subscribers: rnk, joker.eph, llvm-commits
Differential Revision: http://reviews.llvm.org/D7349
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231842
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Tue, 10 Mar 2015 20:45:38 +0000 (20:45 +0000)]
[AArch64] Avoid going through GPRs for across-vector instructions.
This adds new node types for each intrinsic.
For instance, for addv, we have AArch64ISD::UADDV, such that:
(v4i32 (uaddv ...))
is the same as
(v4i32 (scalar_to_vector (i32 (int_aarch64_neon_uaddv ...))))
that is,
(v4i32 (INSERT_SUBREG (v4i32 (IMPLICIT_DEF)),
(i32 (int_aarch64_neon_uaddv ...)), ssub)
In a combine, we transform all such across-vector-lanes intrinsics to:
(i32 (extract_vector_elt (uaddv ...), 0))
This has one big advantage: by making the extract_element explicit, we
enable the existing patterns for lane-aware instructions to fire.
This lets us avoid needlessly going through the GPRs. Consider:
uint32x4_t test_mul(uint32x4_t a, uint32x4_t b) {
return vmulq_n_u32(a, vaddvq_u32(b));
}
We now generate:
addv.4s s1, v1
mul.4s v0, v0, v1[0]
instead of the previous:
addv.4s s1, v1
fmov w8, s1
dup.4s v1, w8
mul.4s v0, v1, v0
rdar://
20044838
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231840
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Tue, 10 Mar 2015 20:37:19 +0000 (20:37 +0000)]
[AArch64] Remove integer INSvi*lane patterns. NFCI.
Most are redundant, and they never seem to fire.
The V128 integer patterns already exist in the INS multiclass.
The duplicates only fire when the vector index type isn't i64,
because they accept "imm" instead of an explicit "i64", as the
instruction definition patterns do.
TLI::getVectorIdxTy is i64 on AArch64, so this should never happen.
Also, one of them had a typo: for i64, INSvi32lane was used.
I noticed because I mistakenly used an explicit i32 as the idx type,
and got ins.s for an i64 vector_insert.
The V64 patterns also don't seem to ever fire, as V64 vector
extract/insert are legalized to V128.
The equivalent float patterns are unique and useful, so keep them.
No functional change intended; none exhibited on the LIT and LNT tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231838
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 10 Mar 2015 20:29:59 +0000 (20:29 +0000)]
Don't evaluate rend() on every iteration of the loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231837
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 10 Mar 2015 20:23:29 +0000 (20:23 +0000)]
LoopAccessAnalysis: Silence -Wreturn-type diagnostic from GCC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231836
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 10 Mar 2015 20:07:44 +0000 (20:07 +0000)]
Don't use LLVM_LIBRARY_VISIBILITY in cpp files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231831
91177308-0d34-0410-b5e6-
96231b3b80d8
Bruno Cardoso Lopes [Tue, 10 Mar 2015 20:05:23 +0000 (20:05 +0000)]
[AsmPrinter][TLOF] Reintroduce AArch64 test
Follow up from r231505.
Fix the non-determinism by using a MapVector and reintroduce the AArch64
testcase. Defer deleting the got candidates up to the end and remove
them in a bulk, avoiding linear time removal of each element.
Thanks to Renato Golin for trying it out on other platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231830
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Tue, 10 Mar 2015 20:04:44 +0000 (20:04 +0000)]
[Hexagon] Adding nodes for PIC support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231829
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Tue, 10 Mar 2015 19:53:14 +0000 (19:53 +0000)]
[Hexagon] Adding DuplexInst instruction format and duplex class defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231828
91177308-0d34-0410-b5e6-
96231b3b80d8
Kit Barton [Tue, 10 Mar 2015 19:49:38 +0000 (19:49 +0000)]
Change the generation of the vmuluwm instruction to be based on the MUL opcode.
Phabricator review: http://reviews.llvm.org/D8185
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231827
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 10 Mar 2015 19:42:57 +0000 (19:42 +0000)]
remove function names from comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231826
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Tue, 10 Mar 2015 19:40:03 +0000 (19:40 +0000)]
[Hexagon] Adding nodes for vector insert/extract lowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231825
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Tue, 10 Mar 2015 19:29:53 +0000 (19:29 +0000)]
[Hexagon] Renaming HexagonJT to JT and adding CP for constantpool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231824
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 10 Mar 2015 19:23:37 +0000 (19:23 +0000)]
Change the datatype of DwarfExpression::Emit(Un)Signed to (u)int64_t
so it matches the one used by ByteStreamer::Emit(U|S)LEB128.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231823
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 10 Mar 2015 19:20:52 +0000 (19:20 +0000)]
NVPTX: move NVPTXAllocaHoisting into the cpp file
Also initialize without using static initialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231822
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Tue, 10 Mar 2015 19:12:41 +0000 (19:12 +0000)]
[LAA-memchecks] Comment improvement
I forgot to roll this into r231816. It was requested by Hal in D8122.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231821
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Tue, 10 Mar 2015 19:07:41 +0000 (19:07 +0000)]
Enable loop-rotate before loop-vectorize by default
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231820
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Tue, 10 Mar 2015 18:54:26 +0000 (18:54 +0000)]
[LAA-memchecks 3/3] Introduce pointer partitions for memchecks
This is the final patch that actually introduces the new parameter of
partition mapping to RuntimePointerCheck::needsChecking.
Another API (LAI::getInstructionsForAccess) is also exposed that helps
to map pointers to instructions because ultimately we partition
instructions.
The WIP version of the Loop Distribution pass in D6930 has been adapted
to use all this. See for example, how
InstrPartitionContainer::computePartitionSetForPointers sets up the
partitions using the above API and then calls to LAI::addRuntimeCheck
with the pointer partitions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231818
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Tue, 10 Mar 2015 18:54:23 +0000 (18:54 +0000)]
[LAA-memchecks 2/3] Move number of memcheck threshold checking to LV
Now the analysis won't "fail" if the memchecks exceed the threshold. It
is the transform pass' responsibility to perform the check.
This allows the transform pass to further analyze/eliminate the
memchecks. E.g. in Loop distribution we only need to check pointers
that end up in different partitions.
Note that there is a slight change of functionality here. The logic in
analyzeLoop is that if dependence checking fails due to non-constant
distance between the pointers, another attempt is made to prove safety
of the dependences purely using run-time checks.
Before this patch we could fail the loop due to exceeding the memcheck
threshold after the first step, now we only check the threshold in the
client after the full analysis. There is no measurable compile-time
effect but I wanted to record this here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231817
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Tue, 10 Mar 2015 18:54:19 +0000 (18:54 +0000)]
[LAA-memchecks 1/3] Split out NumComparisons checks. NFC
The check for the number of memchecks will be moved to the client of
this analysis. Besides allowing for transform-specific thresholds, this
also lets Loop Distribution post-process the memchecks; Loop
Distribution only needs memchecks between pointers of different
partitions.
The motivation for this first patch is to untangle the CanDoRT check
from the NumComparison check before moving the NumComparison part.
CanDoRT means that we couldn't determine the bounds for the pointer.
Note that NumComparison is set independent of this flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231816
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 10 Mar 2015 18:41:22 +0000 (18:41 +0000)]
remove names from comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231813
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 10 Mar 2015 18:37:05 +0000 (18:37 +0000)]
fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231812
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 10 Mar 2015 18:19:24 +0000 (18:19 +0000)]
NVPTX: Remove copy of LLVMInitializeNVPTXAsmPrinter.
If anyone is using this for some strange reason,
LLVMInitializeNVPTXAsmPrinter does exactly the same thing and is what
other LLVM tools are calling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231810
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 10 Mar 2015 18:19:16 +0000 (18:19 +0000)]
Hexagon: Remove unused InstrMapping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231809
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Tue, 10 Mar 2015 17:40:43 +0000 (17:40 +0000)]
[LoopAccesses 3/3] Print the dependences with -analyze
The dependences are now expose through the new getInterestingDependences
API so we can use that with -analyze too and fix the FIXME.
This lets us remove the test that relied on -debug to check the
dependences.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231807
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Tue, 10 Mar 2015 17:40:37 +0000 (17:40 +0000)]
[LoopAccesses 2/3] Allow querying of interesting dependences
Gather an array of interesting dependences rather than just failing
after the first unsafe one and regarding the loop unsafe. Loop
Distribution needs to be able to collect all dependences in order to
isolate the dependence cycles into their own partition.
Since the dependence checking algorithm is quadratic in terms of
accesses sharing the same underlying pointer, I am applying a cut-off
threshold (MaxInterestingDependence). Exceeding that, the logic reverts
back to the original approach deeming the loop unsafe upon encountering
the first unsafe dependence.
The main idea of the patch is to split isDepedent from directly
answering the question whether the dep is safe for vectorization to
return a dependence type which then gets mapped to old boolean result
using Dependence::isSafeForVectorization.
Tested that this was compile-time neutral on SpecINT2006 LTO bitcode
inputs. No assembly change on the testsuite including external.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231806
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Tue, 10 Mar 2015 17:40:34 +0000 (17:40 +0000)]
[LoopAccesses 1/3] Expose MemoryDepChecker to LAA users
LoopDistribution needs to query various results of the dependence
analysis. This series will expose some more APIs and state of the
dependence checker.
This patch is a simple one to just expose the DepChecker instance. The
set is compile-time neutral measured with LTO bitcode files of
SpecINT2006. Also there is no assembly change on the testsuite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231805
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 10 Mar 2015 16:58:10 +0000 (16:58 +0000)]
Store an optional section start label in MCSection.
This makes code that uses section relative expressions (debug info) simpler and
less brittle.
This is still a bit awkward as the symbol is created late and has to be
stored in a mutable field.
I will move the symbol creation earlier in the next patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231802
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 10 Mar 2015 16:42:24 +0000 (16:42 +0000)]
remove function names from comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231801
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Laevsky [Tue, 10 Mar 2015 16:26:48 +0000 (16:26 +0000)]
Teach lowering to correctly handle invoke statepoint and gc results tied to them. Note that we still can not lower gc.relocates for invoke statepoints.
Also it extracts getCopyFromRegs helper function in SelectionDAGBuilder as we need to be able to customize type of the register exported from basic block during lowering of the gc.result.
(Resubmitting this change after not being able to reproduce buildbot failure)
Differential Revision: http://reviews.llvm.org/D7760
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231800
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 10 Mar 2015 16:22:52 +0000 (16:22 +0000)]
[BranchFolding] Remove MMOs during tail merge to preserve dependencies.
When tail merging it may be necessary to remove MMOs from memory operations to
ensures later passes (e.g., MI sched) conservatively compute dependencies.
Currently, we only remove the MMO from the common tail if the MMO doesn't match
with the relative instruction in the non-common tail(s).
A more robust solution would be to add multiple MMOs from the duplicate MIs to
the new MI. Currently ScheduleDAGInstrs.cpp ignores all MMOs on instructions
with multiple MMOs, so this solution is equivalent for the time being.
No test case included as this is incredibly difficult to reproduce.
Patch was a collaborative effort between Ana Pazos and myself.
Phabricator: http://reviews.llvm.org/D7769
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231799
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Tue, 10 Mar 2015 16:16:51 +0000 (16:16 +0000)]
R600/SI: Add _IDXEN and _BOTHEN variants for buffer_store
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231798
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Tue, 10 Mar 2015 16:16:49 +0000 (16:16 +0000)]
R600/SI: Re-order MUBUF operands to match asm strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231797
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Tue, 10 Mar 2015 16:16:48 +0000 (16:16 +0000)]
R600/SI: Move kill flag to second instruction when splitting SMRD
This fixes a machine verifier error in the salu-to-valu.ll, which
would have been exposed by a future commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231796
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Tue, 10 Mar 2015 16:16:44 +0000 (16:16 +0000)]
R600/SI: Add 32-bit encoding of v_cndmask_b32
This was done by refactoring the v_cndmask_b32 tablegen definition
to use inherit from VOP2Inst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231795
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 10 Mar 2015 16:08:36 +0000 (16:08 +0000)]
[X86, AVX] replace vinsertf128 intrinsics with generic shuffles
We want to replace as much custom x86 shuffling via intrinsics
as possible because pushing the code down the generic shuffle
optimization path allows for better codegen and less complexity
in LLVM.
This is the sibling patch for the Clang half of this change:
http://reviews.llvm.org/D8088
Differential Revision: http://reviews.llvm.org/D8086
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231794
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 10 Mar 2015 15:06:38 +0000 (15:06 +0000)]
Hexagon: Remove pass that does nothing at all
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231791
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 10 Mar 2015 14:48:01 +0000 (14:48 +0000)]
Remove effectively dead code.
Switching back and forth between sections does nothing (other than producing
larger .s files).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231790
91177308-0d34-0410-b5e6-
96231b3b80d8
Karthik Bhat [Tue, 10 Mar 2015 14:32:02 +0000 (14:32 +0000)]
Fix a memory corruption in Dependency Analysis.
This crash occurs due to memory corruption when trying to update dependency
direction based on Constraints.
This crash was observed during lnt regression of Polybench benchmark test case dynprog.
Review: http://reviews.llvm.org/D8059
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231788
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 10 Mar 2015 13:56:44 +0000 (13:56 +0000)]
Don't repeat names and clang-format this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231786
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 10 Mar 2015 13:56:28 +0000 (13:56 +0000)]
Removing dead code to silence warning C4060: switch statement contains no 'case' or 'default' labels; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231785
91177308-0d34-0410-b5e6-
96231b3b80d8
Karthik Bhat [Tue, 10 Mar 2015 13:31:03 +0000 (13:31 +0000)]
Fix a crash in Dependency Analysis.
This crash in Dependency analysis is because we assume here that in case of UsefulGEP
both source and destination have the same number of operands which may not be true.
This incorrect assumption results in crash while populating Pairs. Fix the same.
This crash was observed during lnt regression for code such as-
struct s{
int A[10][10];
int C[10][10][10];
} S;
void dep_constraint_crash_test(int k,int N) {
for( int i=0;i<N;i++)
for( int j=0;j<N;j++)
S.A[0][0] = S.C[0][0][k];
}
Review: http://reviews.llvm.org/D8162
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231784
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Tue, 10 Mar 2015 10:42:59 +0000 (10:42 +0000)]
The operand flag word used in ISD::INLINEASM is an i32 not a pointer. NFC.
Summary:
This is part of the work to support memory constraints that behave
differently to 'm'. The subsequent patches will expand on the existing
encoding (which is a 32-bit int) and as a result in some flag words will no
longer fit into an i16. This problem only affected the MSP430 target which
appears to have 16-bit pointers.
Reviewers: hfinkel
Reviewed By: hfinkel
Subscribers: hfinkel, llvm-commits
Differential Revision: http://reviews.llvm.org/D8168
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231783
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Tue, 10 Mar 2015 07:33:23 +0000 (07:33 +0000)]
Teach raw_ostream to accept SmallString.
Saves adding .str() call to any raw_ostream << SmallString usage
and a small step towards making .str() consistent in the ADTs by
removing one of the SmallString::str() use cases, discussion at
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-
20141013/240026.html
I'll update the Phabricator patch http://reviews.llvm.org/D6372
for review of the Twine SmallString support, it's more complex
than this one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231763
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 10 Mar 2015 06:51:39 +0000 (06:51 +0000)]
Fix a crash in InstCombine where we could try to truncate a switch comparison to zero width.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231761
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 10 Mar 2015 06:34:57 +0000 (06:34 +0000)]
Fix a stack overflow in the assembler when checking that GEPs must be over sized types.
We failed to use a marking set to properly handle recursive types, which caused use
to recurse infinitely and eventually overflow the stack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231760
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 10 Mar 2015 05:58:21 +0000 (05:58 +0000)]
Fix an issue in the verifier where we could try to read information out of a malformed statepoint intrinsic.
In this situation we would always have already flagged an error on the statepoint intrinsic,
but then we carry on to parse other, related GC intrinsics, and could end up crashing during that
verification when they try to access data from the malformed statepoint.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231759
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 10 Mar 2015 05:13:47 +0000 (05:13 +0000)]
Fix an infinite loop in InstCombine when an instruction with no users and side effects can be constant folded.
ReplaceInstUsesWith needs to return nullptr when the input has no users,
because in that case it does not mutate the program. Otherwise, we can
get stuck in an infinite loop of repeatedly attempting to constant fold
and instruction with no users.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231755
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 10 Mar 2015 04:28:09 +0000 (04:28 +0000)]
Move variable into assert to fix -Asserts builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231753
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 10 Mar 2015 04:11:52 +0000 (04:11 +0000)]
Remove incredibly confusing isBaseAddressKnownZero.
When referring to a symbol in a dwarf section on ELF we should use
.long foo
instead of
.long foo - .debug_something
because ELF is unaware of the content of the sections and therefore needs
relocations. This has nothing to do with optimizing a -0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231751
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 10 Mar 2015 03:58:36 +0000 (03:58 +0000)]
Use a better name for compile unit labels.
They mark the start of a compile unit, so name them .Lcu_*. Using
Section->getLabelBeginName() makes it looks like they mark the start of the
section.
While at it, switch to createTempSymbol to avoid collisions with labels
created in inline assembly. Not sure if a "don't crash" test is worth it.
With this getLabelBeginName is dead, delete it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231750
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 10 Mar 2015 03:48:14 +0000 (03:48 +0000)]
removed function names from comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231749
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Tue, 10 Mar 2015 03:47:55 +0000 (03:47 +0000)]
DwarfAccelTable: remove unneeded bucket terminators.
Last commit fixed the handling of hash collisions, but it introdcuced
unneeded bucket terminators in some places. The generated table was
correct, it can just be a tiny bit smaller. As the previous table was
correct, the test doesn't need updating. If we really wanted to test
this, I could add the section size to the dwarf dump and test for a
precise value there. IMO the correctness test is sufficient.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231748
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 10 Mar 2015 03:26:39 +0000 (03:26 +0000)]
use range-based for loops; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231747
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 10 Mar 2015 03:25:07 +0000 (03:25 +0000)]
Improve and simplify EnforceSmallerThan for vector types.
Explicitly compare the size of the scalar types and the whole vector size rather than just comparing enum encodings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231746
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 10 Mar 2015 03:25:04 +0000 (03:25 +0000)]
Remove extra indentation of entire function body. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231745
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 10 Mar 2015 03:11:11 +0000 (03:11 +0000)]
Move label creation close to emission. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231744
91177308-0d34-0410-b5e6-
96231b3b80d8
George Burgess IV [Tue, 10 Mar 2015 02:58:15 +0000 (02:58 +0000)]
Added ConstantExpr support to CFLAA.
CFLAA didn't know how to properly handle ConstantExprs; it would silently
ignore them. This was a problem if the ConstantExpr is, say, a GEP of a global,
because CFLAA wouldn't realize that there's a global there. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231743
91177308-0d34-0410-b5e6-
96231b3b80d8
George Burgess IV [Tue, 10 Mar 2015 02:40:06 +0000 (02:40 +0000)]
Added special handling for inttoptr in CFLAA.
We now treat pointers given to ptrtoint and pointers retrieved from
inttoptr as similar to arguments or globals (can alias anything, etc.)
This solves some of the problems we were having with giving incorrect
results.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231741
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Tue, 10 Mar 2015 02:37:25 +0000 (02:37 +0000)]
DataLayout is mandatory, update the API to reflect it with references.
Summary:
Now that the DataLayout is a mandatory part of the module, let's start
cleaning the codebase. This patch is a first attempt at doing that.
This patch is not exactly NFC as for instance some places were passing
a nullptr instead of the DataLayout, possibly just because there was a
default value on the DataLayout argument to many functions in the API.
Even though it is not purely NFC, there is no change in the
validation.
I turned as many pointer to DataLayout to references, this helped
figuring out all the places where a nullptr could come up.
I had initially a local version of this patch broken into over 30
independant, commits but some later commit were cleaning the API and
touching part of the code modified in the previous commits, so it
seemed cleaner without the intermediate state.
Test Plan:
Reviewers: echristo
Subscribers: llvm-commits
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231740
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Tue, 10 Mar 2015 01:58:27 +0000 (01:58 +0000)]
[sanitizer] fix instrumentation with -mllvm -sanitizer-coverage-block-threshold=0 to actually do something useful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231736
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Tue, 10 Mar 2015 01:11:53 +0000 (01:11 +0000)]
[sanitizer] decrease sanitizer-coverage-block-threshold from 1000 to 500 as another horrible workaround for PR17409
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231733
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Tue, 10 Mar 2015 00:46:31 +0000 (00:46 +0000)]
DwarfAccelTable: Fix handling of hash collisions.
It turns out accelerator tables where totally broken if they contained
entries with colliding hashes. The failure mode is pretty bad, as it not
only impacted the colliding entries, but would basically make all the
entries after the first hash collision pointing in the wrong place.
The testcase uses the symbol names that where found to collide during a
clang build.
From a performance point of view, the patch adds a sort and a linear
walk over each bucket contents. While it has a measurable impact on the
accelerator table emission, it's not showing up significantly in clang
profiles (and I'd argue that correctness is priceless :-)).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231732
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 10 Mar 2015 00:33:27 +0000 (00:33 +0000)]
Temporarily revert r231726 and r231724 as they're breaking the build.:
Author: Lang Hames <lhames@gmail.com>
Date: Mon Mar 9 23:51:09 2015 +0000
[Orc][MCJIT][RuntimeDyld] Add header that was accidentally left out of r231724.
Author: Lang Hames <lhames@gmail.com>
Date: Mon Mar 9 23:44:13 2015 +0000
[Orc][MCJIT][RuntimeDyld] Add symbol flags to symbols in RuntimeDyld. Thread the
new types through MCJIT and Orc.
In particular, add a 'weak' flag. When plumbed through RTDyldMemoryManager, this
will allow us to distinguish between weak and strong definitions and find the
right ones during symbol resolution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231731
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 10 Mar 2015 00:33:22 +0000 (00:33 +0000)]
Remove an unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231730
91177308-0d34-0410-b5e6-
96231b3b80d8
Ben Langmuir [Tue, 10 Mar 2015 00:04:29 +0000 (00:04 +0000)]
Don't treat .foo as two path components in path::iterators
We were treating '/.foo' as ['/', '.', 'foo'] instead of ['/', '.foo'],
which lead to insanity. Same for '..'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231727
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 9 Mar 2015 23:51:09 +0000 (23:51 +0000)]
[Orc][MCJIT][RuntimeDyld] Add header that was accidentally left out of r231724.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231726
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 9 Mar 2015 23:44:13 +0000 (23:44 +0000)]
[Orc][MCJIT][RuntimeDyld] Add symbol flags to symbols in RuntimeDyld. Thread the
new types through MCJIT and Orc.
In particular, add a 'weak' flag. When plumbed through RTDyldMemoryManager, this
will allow us to distinguish between weak and strong definitions and find the
right ones during symbol resolution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231724
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 9 Mar 2015 23:08:46 +0000 (23:08 +0000)]
[Hexagon] Removing unused patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231723
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 9 Mar 2015 23:08:44 +0000 (23:08 +0000)]
LLParser: gep: Simplify parsing error handling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231722
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Mon, 9 Mar 2015 22:51:05 +0000 (22:51 +0000)]
[CodeGen] Replace the reused stores' chain for extractelt expansion.
This fixes a subtle issue that was introduced in r205153.
When reusing a store for the extractelement expansion (to load directly
from it, inserting of going through the stack), later stores to the
same location might have overwritten the data we were expecting to
extract from.
To fix that, we need to explicitly replace the chain going out of the
reused store, so that later stores also have an explicit dependency on
the generated element-extracting loads, and can't clobber them.
rdar://
20066785
Differential Revision: http://reviews.llvm.org/D8180
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231721
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Mon, 9 Mar 2015 22:46:02 +0000 (22:46 +0000)]
[X86] Add nounwind to vector-idiv.ll testcases. NFC.
In preparation for a patch where cfi directives get in the way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231720
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 9 Mar 2015 22:45:16 +0000 (22:45 +0000)]
Reland r229944: EH: Prune unreachable resume instructions during Dwarf EH preparation
Fix the double-deletion of AnalysisResolver when delegating through to
Dwarf EH preparation by creating one from scratch. Hopefully the new
pass manager simplifies this.
This reverts commit r229952.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231719
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 9 Mar 2015 22:08:37 +0000 (22:08 +0000)]
Use a MapVector instead of an extra sort.
This also has the advantage of not depending on the brittle getLabelBeginName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231714
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 9 Mar 2015 22:05:21 +0000 (22:05 +0000)]
[Hexagon] Use single tailcall pseudoinst and fix checking for label jumping versus tail calling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231713
91177308-0d34-0410-b5e6-
96231b3b80d8