OSDN Git Service
NAKAMURA Takumi [Sat, 17 Jun 2017 03:19:08 +0000 (03:19 +0000)]
[CMake] Introduce LLVM_TARGET_TRIPLE_ENV as an option to override LLVM_DEFAULT_TARGET_TRIPLE at runtime.
No behavior is changed if LLVM_TARGET_TRIPLE_ENV is blank or undefined.
If LLVM_TARGET_TRIPLE_ENV is "TEST_TARGET_TRIPLE" and $TEST_TARGET_TRIPLE is not blank,
llvm::sys::getDefaultTargetTriple() returns $TEST_TARGET_TRIPLE.
Lit resets config.target_triple and config.environment[LLVM_TARGET_TRIPLE_ENV] to change the default target.
Without changing LLVM_DEFAULT_TARGET_TRIPLE nor rebuilding, lit can be run;
TEST_TARGET_TRIPLE=i686-pc-win32 bin/llvm-lit -sv path/to/test/
TEST_TARGET_TRIPLE=i686-pc-win32 ninja check-clang-tools
Differential Revision: https://reviews.llvm.org/D33662
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305632
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Sat, 17 Jun 2017 02:25:56 +0000 (02:25 +0000)]
Rework logic and comment out the default relocation models for PPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305630
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Sat, 17 Jun 2017 02:25:55 +0000 (02:25 +0000)]
Turn a large if block into a smaller early return for clarity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305629
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Sat, 17 Jun 2017 02:25:53 +0000 (02:25 +0000)]
Remove the old and unused PPC32 and PPC64TargetMachine classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305628
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Sat, 17 Jun 2017 02:25:51 +0000 (02:25 +0000)]
Remove unused forward declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305627
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Sat, 17 Jun 2017 02:25:49 +0000 (02:25 +0000)]
Tidy up some calls to getRegister for readability.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305626
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Sat, 17 Jun 2017 02:08:18 +0000 (02:08 +0000)]
RegScavenging: Add scavengeRegisterBackwards()
Re-apply r276044/r279124/r305516. Fixed a problem where we would refuse
to place spills as the very first instruciton of a basic block and thus
artifically increase pressure (test in
test/CodeGen/PowerPC/scavenging.mir:spill_at_begin)
This is a variant of scavengeRegister() that works for
enterBasicBlockEnd()/backward(). The benefit of the backward mode is
that it is not affected by incomplete kill flags.
This patch also changes
PrologEpilogInserter::doScavengeFrameVirtualRegs() to use the register
scavenger in backwards mode.
Differential Revision: http://reviews.llvm.org/D21885
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305625
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Shen [Sat, 17 Jun 2017 01:25:34 +0000 (01:25 +0000)]
[PPC] Remove isBarrier from CFENCE8's definition.
Summary:
This is my misunderstanding on isBarrier. It's not for memory barriers,
but for other control flow purposes. lwsync doesn't have it either.
This fixes a simple crash with -verify-machineinstrs like below:
define void @Foo() {
entry:
%tmp = load atomic i64, i64* undef acquire, align 8
unreachable
}
I deliberately don't want to check in the test, since there is little
chance to regress on such a mistake. Such a test adds noise to the code
base.
I plan to check in first, since it fixes a crash, and the fix is obvious.
Reviewers: kbarton, echristo
Subscribers: sanjoy, nemanjai, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D34314
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305624
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sat, 17 Jun 2017 00:56:27 +0000 (00:56 +0000)]
[SelectionDAG] Update Loop info after splitting critical edges.
The analysis is expected to be preserved by SelectionDAG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305621
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sat, 17 Jun 2017 00:07:22 +0000 (00:07 +0000)]
[InstCombine] Make FPMathOperator working with ConstantExpression(s).
Fixes PR33453.
Differential Revision: https://reviews.llvm.org/D34303
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305618
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Sat, 17 Jun 2017 00:02:24 +0000 (00:02 +0000)]
Don't crash if a type record can't be found.
This was a regression introduced in a previous patch. Adding
back the code that handles this case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305617
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Clegg [Fri, 16 Jun 2017 23:59:10 +0000 (23:59 +0000)]
[WebAssembly] Use __stack_pointer global when writing wasm binary
This ensures that symbolic relocations are generated for stack
pointer manipulations.
These relocations are of type R_WEBASSEMBLY_GLOBAL_INDEX_LEB.
This change also adds support for reading relocations of this
type in WasmObjectFile.cpp.
Since its a globally imported symbol this does mean that
the get_global/set_global instruction won't be valid until
the objects are linked that global used in no longer an
imported global.
Differential Revision: https://reviews.llvm.org/D34172
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305616
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 16 Jun 2017 23:42:44 +0000 (23:42 +0000)]
[CodeView] Fix random access of type names.
Suppose we had a type index offsets array with a boundary at type index
N. Then you request the name of the type with index N+1, and that name
requires the name of index N-1 (think a parameter list, for example). We
didn't handle this, and we would print something like (<unknown UDT>,
<unknown UDT>).
The fix for this is not entirely trivial, and speaks to a larger
problem. I think we need to kill TypeDatabase, or at the very least kill
TypeDatabaseVisitor. We need a thing that doesn't do any caching
whatsoever, just given a type index it can compute the type name "the
slow way". The reason for the bug is that we don't have anything like
that. Everything goes through the type database, and if we've visited a
record, then we're "done". It doesn't know how to do the expensive thing
of re-visiting dependent records if they've not yet been visited.
What I've done here is more or less copied the code (albeit greatly
simplified) from TypeDatabaseVisitor, but wrapped it in an interface
that just returns a std::string. The logic of caching the name is now in
LazyRandomTypeCollection. Eventually I'd like to move the record
database here as well and the visited record bitfield here as well, at
which point we can actually just delete TypeDatabase. I don't see any
reason for it if a "sequential" collection is just a special case of a
random access collection with an empty partial offsets array.
Differential Revision: https://reviews.llvm.org/D34297
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305612
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 16 Jun 2017 23:42:15 +0000 (23:42 +0000)]
Remove some dead code / includes.
I'm trying to get rid of the TypeDatabase class, so the first
step is to minimize its footprint.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305611
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Clegg [Fri, 16 Jun 2017 23:29:54 +0000 (23:29 +0000)]
obj2yaml: Improve error reporting
Previously only the error codes were reported which
meant that useful information about malformed inputs
was not shown.
Differential Revision: https://reviews.llvm.org/D34008
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305609
91177308-0d34-0410-b5e6-
96231b3b80d8
Yonghong Song [Fri, 16 Jun 2017 23:28:04 +0000 (23:28 +0000)]
bpf: fix a strict-aliasing issue
Davide Italiano reported the following issue if llvm
is compiled with gcc -Wstrict-aliasing -Werror:
.....
lib/Target/BPF/CMakeFiles/LLVMBPFCodeGen.dir/BPFISelDAGToDAG.cpp.o
../lib/Target/BPF/BPFISelDAGToDAG.cpp: In member function ‘virtual
void {anonymous}::BPFDAGToDAGISel::PreprocessISelDAG()’:
../lib/Target/BPF/BPFISelDAGToDAG.cpp:264:26: warning: dereferencing
type-punned pointer will break strict-aliasing rules
[-Wstrict-aliasing]
val = *(uint16_t *)new_val;
.....
The error is caused by my previous commit (revision 305560).
This patch fixed the issue by introducing an union to avoid
type casting.
Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305608
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 16 Jun 2017 23:26:23 +0000 (23:26 +0000)]
[ConstantRange] Implement getSignedMin/Max in a less complicated and faster way
Summary: As far as I can tell we should be able to implement these almost the same way we do unsigned, but using signed comparisons and checks for min signed value instead of min unsigned value.
Reviewers: pete, davide, sanjoy
Reviewed By: davide
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33815
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305607
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 16 Jun 2017 23:19:14 +0000 (23:19 +0000)]
[SelectionDAG] Use APInt::isSubsetOf. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305606
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 16 Jun 2017 23:19:12 +0000 (23:19 +0000)]
[SelectionDAG] Use APInt::isNullValue/isOneValue. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305605
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 16 Jun 2017 23:19:10 +0000 (23:19 +0000)]
[TargetLowering] Use ConstantSDNode::isOne and getSExtValue instead of getting the underlying APInt first. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305604
91177308-0d34-0410-b5e6-
96231b3b80d8
Wei Mi [Fri, 16 Jun 2017 23:14:35 +0000 (23:14 +0000)]
Revert rL305578. There is still some buildbot failure to be fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305603
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 16 Jun 2017 23:02:05 +0000 (23:02 +0000)]
Move testcase into the target-appropriate subdirectory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305602
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 16 Jun 2017 22:40:04 +0000 (22:40 +0000)]
Improve the accuracy of variable ranges .debug_loc location lists.
For the following motivating example
bool c();
void f();
bool start() {
bool result = c();
if (!c()) {
result = false;
goto exit;
}
f();
result = true;
exit:
return result;
}
we would previously generate a single DW_AT_const_value(1) because
only the DBG_VALUE in the second-to-last basic block survived
codegen. This patch improves the heuristic used to determine when a
DBG_VALUE is available at the beginning of its variable's enclosing
lexical scope:
- Stop giving singular constants blanket permission to take over the
entire scope. There is still a special case for constants in the
function prologue that we also miight want to retire later.
- Use the lexical scope information to determine available-at-entry
instead of proximity to the function prologue.
After this patch we generate a location list with a more accurate
narrower availability for the constant true value. As a pleasant side
effect, we also generate inline locations instead of location lists
where a loacation covers the entire range of the enclosing lexical
scope.
Measured on compiling llc with four targets this doesn't have an
effect on compile time and reduces the size of the debug info for llc
by ~600K.
rdar://problem/
30286912
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305599
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Fri, 16 Jun 2017 22:15:18 +0000 (22:15 +0000)]
utils: Add a git-r utility for mapping svn revisions to git revisions in the monorepo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305598
91177308-0d34-0410-b5e6-
96231b3b80d8
Spyridoula Gravani [Fri, 16 Jun 2017 22:03:21 +0000 (22:03 +0000)]
[DWARF] Corrected behavior for when no .apple_names section is present in the object.
The verifier should not output any message in such a case.
Added test case with no .apple_name section in the file to verify new functionality.
Made existing test case more specific.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305597
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Beckmann [Fri, 16 Jun 2017 22:00:42 +0000 (22:00 +0000)]
Clean up some things in the WindowsResource changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305596
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 16 Jun 2017 21:27:12 +0000 (21:27 +0000)]
[Object] Remove redundant std::move.
Found by -Wpessimizing-move.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305595
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Beckmann [Fri, 16 Jun 2017 21:13:24 +0000 (21:13 +0000)]
Switch external cvtres.exe for llvm's own resource library.
In this patch, I flip the switch in DriverUtils from using the external
cvtres.exe tool to using the Windows Resource library in llvm.
I also fixed a bug where .rsrc sections were marked as discardable
memory and therefore were placed in the wrong order in the final PE.
Furthermore, I modified WindowsResource to write the coff directly to a
memory buffer instead of to file, also had it use the machine types
already declared in COFF.h instead creating my own enum.
Finally, I flipped the switch to allow all unit tests that had
previously run only on windows due to a winres dependency to run
cross-platform.
Reviewers: zturner, ruiu
Subscribers: llvm-commits, hiraditya
Differential Revision: https://reviews.llvm.org/D34265
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305592
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Thomas [Fri, 16 Jun 2017 21:08:37 +0000 (21:08 +0000)]
[InstCombine] Set correct insertion point for selects generated while folding phis
Summary:
When we fold vector constants that are operands of phi's that feed into select,
we need to set the correct insertion point for the *new* selects that get generated.
The correct insertion point is the incoming block for the phi.
Such cases can occur with patch r298845, which fixed folding of
vector constants, but the new selects could be inserted incorrectly (as the added
test case shows).
Reviewers: majnemer, spatel, sanjoy
Reviewed by: spatel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34162
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305591
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Fri, 16 Jun 2017 20:50:41 +0000 (20:50 +0000)]
Change YAML traits for vector<string> to flow_vector.
This is a workaround for an ODR conflict with the definition in
AMDGPUCodeObjectMetadata.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305584
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Fri, 16 Jun 2017 20:50:31 +0000 (20:50 +0000)]
[SCCP] Simplify the code a bit. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305583
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Fri, 16 Jun 2017 20:27:17 +0000 (20:27 +0000)]
[SCCP] Clarify a comment about unhandled instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305579
91177308-0d34-0410-b5e6-
96231b3b80d8
Wei Mi [Fri, 16 Jun 2017 20:21:01 +0000 (20:21 +0000)]
[GVN] Recommit the patch "Add phi-translate support in scalarpre".
The recommit fixes two bugs: The first one is to use CurrentBlock instead of
PREInstr's Parent as param of performScalarPREInsertion because the Parent
of a clone instruction may be uninitialized. The second one is stop PRE when
CurrentBlock to its predecessor is a backedge and an operand of CurInst is
defined inside of CurrentBlock. The same value defined inside of loop in last
iteration can not be regarded as available.
Right now scalarpre doesn't have phi-translate support, so it will miss some
simple pre opportunities. Like the following testcase, current scalarpre cannot
recognize the last "a * b" is fully redundent because a and b used by the last
"a * b" expr are both defined by phis.
long a[100], b[100], g1, g2, g3;
__attribute__((pure)) long goo();
void foo(long a, long b, long c, long d) {
g1 = a * b;
if (__builtin_expect(g2 > 3, 0)) {
a = c;
b = d;
g2 = a * b;
}
g3 = a * b; // fully redundant.
}
The patch adds phi-translate support in scalarpre. This is only a temporary
solution before the newpre based on newgvn is available.
Differential Revision: https://reviews.llvm.org/D32252
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305578
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Fri, 16 Jun 2017 19:43:57 +0000 (19:43 +0000)]
[SCCP] Remove redundant instruction visitors.
Whenever we don't know what to do with an instruction, we send
it to overdefined anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305575
91177308-0d34-0410-b5e6-
96231b3b80d8
Spyridoula Gravani [Fri, 16 Jun 2017 18:55:01 +0000 (18:55 +0000)]
[DWARF] Replaced mem-initializers with non-static data member initializers in DWARFVerifier class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305570
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 16 Jun 2017 17:48:08 +0000 (17:48 +0000)]
Revert "RegScavenging: Add scavengeRegisterBackwards()"
Revert because of reports of some PPC input starting to spill when it
was predicted that it wouldn't and no spillslot was reserved.
This reverts commit r305516.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305566
91177308-0d34-0410-b5e6-
96231b3b80d8
Xinliang David Li [Fri, 16 Jun 2017 16:54:13 +0000 (16:54 +0000)]
Fix function name /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305564
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 16 Jun 2017 16:44:36 +0000 (16:44 +0000)]
[InstCombine] Add test cases to show missed opportunities due to overly conservative single use checks. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305562
91177308-0d34-0410-b5e6-
96231b3b80d8
Yonghong Song [Fri, 16 Jun 2017 15:41:16 +0000 (15:41 +0000)]
bpf: avoid load from read-only sections
If users tried to have a structure decl/init code like below
struct test_t t = { .memeber1 = 45 };
It is very likely that compiler will generate a readonly section
to hold up the init values for variable t. Later load of t members,
e.g., t.member1 will result in a read from readonly section.
BPF program cannot handle relocation. This will force users to
write:
struct test_t t = {};
t.member1 = 45;
This is just inconvenient and unintuitive.
This patch addresses this issue by implementing BPF PreprocessISelDAG.
For any load from a global constant structure or an global array of
constant struct, it attempts to
translate it into a constant directly. The traversal of the
constant struct and other constant data structures are similar
to where the assembler emits read-only sections.
Four different unit test cases are also added to cover
different scenarios.
Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305560
91177308-0d34-0410-b5e6-
96231b3b80d8
Yonghong Song [Fri, 16 Jun 2017 15:30:55 +0000 (15:30 +0000)]
bpf: set missing types in insn tablegen file
o This is discovered during my study of 32-bit subregister
support.
o This is no impact on current functionality since we
only support 64-bit registers.
o Searching the web, looks like the issue has been discovered
before, so fix it now.
Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305559
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Neilson [Fri, 16 Jun 2017 14:43:59 +0000 (14:43 +0000)]
[Atomics] Rename and change prototype for atomic memcpy intrinsic
Summary:
Background: http://lists.llvm.org/pipermail/llvm-dev/2017-May/112779.html
This change is to alter the prototype for the atomic memcpy intrinsic. The prototype itself is being changed to more closely resemble the semantics and parameters of the llvm.memcpy intrinsic -- to ease later combination of the llvm.memcpy and atomic memcpy intrinsics. Furthermore, the name of the atomic memcpy intrinsic is being changed to make it clear that it is not a generic atomic memcpy, but specifically a memcpy is unordered atomic.
Reviewers: reames, sanjoy, efriedma
Reviewed By: reames
Subscribers: mzolotukhin, anna, llvm-commits, skatkov
Differential Revision: https://reviews.llvm.org/D33240
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305558
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Dardis [Fri, 16 Jun 2017 14:00:33 +0000 (14:00 +0000)]
Revert "[mips][microMIPS] Extending size reduction pass with ADDIUSP and ADDIUR1SP"
This reverts commit r305455. This commit was reported as breaking one of
the sanitizer buildbots. Reverting until lab.llvm.org comes back online.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305557
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 16 Jun 2017 13:44:34 +0000 (13:44 +0000)]
[TableGen] Do not assume that the first variant is the original pattern
The variant generation for commutative/associative patterns would simply
delete the first output from the list assuming that it was identical to
the original pattern. This does not have to be the case, and a legitimate
variant could actually be removed that way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305556
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 16 Jun 2017 12:24:03 +0000 (12:24 +0000)]
[Hexagon] Don't kill live registers when creating mux out of tfr
The second part of r305300: when placing the mux at the later location,
make sure that it won't use any register that was killed between the
two original instructions. Remove any such kills and transfer them to
the mux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305553
91177308-0d34-0410-b5e6-
96231b3b80d8
Hiroshi Inoue [Fri, 16 Jun 2017 12:23:04 +0000 (12:23 +0000)]
[MachineBlockPlacement] trivial fix in comments, NFC
- Topologocal is abbreviated as "topo" in comments, but "top" is used in only one comment. Modify it for consistency.
- Capitalize "succ" and "pred" for consistency in one figure.
- Other trivial fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305552
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 16 Jun 2017 05:10:37 +0000 (05:10 +0000)]
[InstCombine] Fold (!iszero(A & K1) & !iszero(A & K2)) -> (A & (K1 | K2)) == (K1 | K2) if K1 and K2 are a 1-bit mask
Summary: This is the demorganed version of the case we already handle for the OR of iszero.
Reviewers: spatel
Reviewed By: spatel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34244
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305548
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Fri, 16 Jun 2017 02:42:33 +0000 (02:42 +0000)]
Fix buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305542
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Fri, 16 Jun 2017 02:17:35 +0000 (02:17 +0000)]
Fix msan buildbot.
This patch should fix sanitizer-x86_64-linux-fast bot.
The problem was that the contents of this stream are aligned to 4 byte,
and the paddings were created just by incrementing `Offset`, so paddings
had undefined values. When the entire stream is written to an output,
it triggered msan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305541
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 16 Jun 2017 01:53:20 +0000 (01:53 +0000)]
[CorrelatedValuePropagation] Remove superfluous semicolon. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305538
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Zelenko [Fri, 16 Jun 2017 00:43:26 +0000 (00:43 +0000)]
[BinaryFormat, Option, TableGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305537
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Fri, 16 Jun 2017 00:32:11 +0000 (00:32 +0000)]
Fix build warning on 32-bit targets where sizeof(size_t) < sizeof(long long).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305535
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Fri, 16 Jun 2017 00:18:29 +0000 (00:18 +0000)]
[cfi] CFI-ICall for ThinLTO.
Implement ControlFlowIntegrity for indirect function calls in ThinLTO.
Design follows the RFC in llvm-dev, see
https://groups.google.com/d/msg/llvm-dev/MgUlaphu4Qc/kywu0AqjAQAJ
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305533
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 16 Jun 2017 00:04:24 +0000 (00:04 +0000)]
[llvm-pdbutil] Add support for dumping cross module imports/exports.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305532
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 15 Jun 2017 23:59:56 +0000 (23:59 +0000)]
[llvm-pdbutil] Add a function for iterating over debug subsections.
NFC, just adds a helper function to reduce boilerplate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305531
91177308-0d34-0410-b5e6-
96231b3b80d8
Xinliang David Li [Thu, 15 Jun 2017 23:56:59 +0000 (23:56 +0000)]
[PartialInlining] Code Refactoring
This is a NFC code refactoring and interface cleanup. This paves the
way to enable outlining-only mode for the partial inliner.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305530
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 15 Jun 2017 23:56:19 +0000 (23:56 +0000)]
[llvm-pdbutil] Add support for dumping lines and inlinee lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305529
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 15 Jun 2017 23:44:19 +0000 (23:44 +0000)]
Try to fix uninitialized read reported by msan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305528
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Thu, 15 Jun 2017 23:29:47 +0000 (23:29 +0000)]
Revert "[DAG] Allow truncated and extend memory operations in Store Merge. NFCI."
This reverts commit r305468, as it caused PR33475.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305527
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 15 Jun 2017 23:12:41 +0000 (23:12 +0000)]
[llvm-pdbutil] Add back support for dumping file checksums.
When dumping module source files, also dump checksums.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305526
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Thu, 15 Jun 2017 23:05:21 +0000 (23:05 +0000)]
test-release.sh: Run the test-suite using phase3 clang
Summary: We were using the system compiler to run the test suite.
Reviewers: hansw
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34246
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305525
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 15 Jun 2017 23:04:42 +0000 (23:04 +0000)]
[llvm-pdbutil] Add back the ability to dump hashes and index offsets.
This was regressed in a previous patch that re-wrote the dumper,
and I'm incrementally adding back the pieces that are missing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305524
91177308-0d34-0410-b5e6-
96231b3b80d8
Alfred Huang [Thu, 15 Jun 2017 23:02:55 +0000 (23:02 +0000)]
[AMDGPU] Testing commit access only, no real change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305523
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 15 Jun 2017 22:50:57 +0000 (22:50 +0000)]
UnitTests: Followup to 305519
We have to use ASSERT_XXX instead of EXPECT_XXX if the test cannot
continue in the failure case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305522
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Thu, 15 Jun 2017 22:43:40 +0000 (22:43 +0000)]
[libFuzzer] change the default max_len from 64 to 4096. This will affect cases where libFuzzer is run w/o initial corpus or with a corpus of very small items.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305521
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 15 Jun 2017 22:31:08 +0000 (22:31 +0000)]
UnitTests: Replace some if(x)report_fatal_error() with EXPECT_TRUE(!x)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305519
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 15 Jun 2017 22:24:24 +0000 (22:24 +0000)]
Resubmit "[llvm-pdbutil] rewrite the "raw" output style."
This resubmits commit
c0c249e9f2ef83e1d1e5f166b50673d92f3579d7.
It was broken due to some weird template issues, which have
since been fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305517
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 15 Jun 2017 22:14:55 +0000 (22:14 +0000)]
RegScavenging: Add scavengeRegisterBackwards()
Re-apply r276044/r279124. Trying to reproduce or disprove the ppc64
problems reported in the stage2 build last time, which I cannot
reproduce right now.
This is a variant of scavengeRegister() that works for
enterBasicBlockEnd()/backward(). The benefit of the backward mode is
that it is not affected by incomplete kill flags.
This patch also changes
PrologEpilogInserter::doScavengeFrameVirtualRegs() to use the register
scavenger in backwards mode.
Differential Revision: http://reviews.llvm.org/D21885
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305516
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 15 Jun 2017 22:09:30 +0000 (22:09 +0000)]
docs/Phabricator: Better git examples to produce full context patches
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305515
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 15 Jun 2017 21:38:48 +0000 (21:38 +0000)]
[InstCombine] Add two FIXMEs for bad single use checks. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305510
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 15 Jun 2017 21:38:44 +0000 (21:38 +0000)]
[InstCombine] Add test cases to demonstrate instcombine increasing instruction count when trying to fold (select (icmp eq (and X, C1), 0), Y, (or Y, C2))->(or (shl (and X, C1), C3), y) when the pieces have multiple uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305509
91177308-0d34-0410-b5e6-
96231b3b80d8
Galina Kistanova [Thu, 15 Jun 2017 21:00:40 +0000 (21:00 +0000)]
Added braces to work around gcc warning in googletest: suggest explicit braces to avoid ambiguous 'else'. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305506
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 15 Jun 2017 20:55:51 +0000 (20:55 +0000)]
Revert "[llvm-pdbutil] rewrite the "raw" output style."
This reverts commit
83ea17ebf2106859a51fbc2a86031b44d33696ad.
This is failing due to some strange template problems, so reverting
until it can be straightened out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305505
91177308-0d34-0410-b5e6-
96231b3b80d8
Spyridoula Gravani [Thu, 15 Jun 2017 20:40:08 +0000 (20:40 +0000)]
[DWARF] Removed dead code. The verifier functionality is provided by
the DWARFVerifier class (as it should).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305503
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Thu, 15 Jun 2017 20:23:57 +0000 (20:23 +0000)]
Split PGO memory intrinsic optimization into its own source file
Summary:
Split the PGOMemOPSizeOpt pass out from IndirectCallPromotion.cpp into
its own file.
Reviewers: davidxl
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D34248
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305501
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 15 Jun 2017 20:03:57 +0000 (20:03 +0000)]
Fix some more warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305499
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 15 Jun 2017 19:45:25 +0000 (19:45 +0000)]
Fix some -Wreorder issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305497
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 15 Jun 2017 19:34:41 +0000 (19:34 +0000)]
[llvm-pdbutil] rewrite the "raw" output style.
After some internal discussions, we agreed that the raw output style had
outlived its usefulness. It was originally created before we had even
thought of dumping to YAML, and it was intended to give us some insight
into the internals of a PDB file. Now we have YAML mode which does
almost exactly this but is more powerful in that it can round-trip back
to a PDB, which the raw mode could not do. So the raw mode had become
purely a maintenance burden.
One option was to just delete it. However, its original goal was to be
as readable as possible while staying close to the "metal" - i.e.
presenting the output in a way that maps directly to the underlying file
format. We don't actually need that last requirement anymore since it's
covered by the yaml mode, so we could repurpose "raw" mode to actually
just be as readable as possible.
This patch implements about 80% of the functionality previously in raw
mode, but in a completely different style that is more akin to what
cvdump outputs. Records are very compressed, often times appearing on
just one line. One nice thing about this is that it makes full record
matching easier, because you can grep for indices, names, and leaf types
on a single line often.
See the tests for some examples of what the new output looks like.
Note that this patch actually regresses the functionality of raw mode in
a few areas, but only because the patch was already unreasonably large
and going 100% would have been even worse. Specifically, this patch is
missing:
The ability to dump module debug subsections (checksums, lines, etc)
The ability to dump section headers
Aside from that everything is here. While goign through the tests fixing
them all up, I found many duplicate tests. They've been deleted. In
subsequent patches I will go through and re-add the missing
functionality.
Differential Revision: https://reviews.llvm.org/D34191
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305495
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Timofeev [Thu, 15 Jun 2017 19:33:10 +0000 (19:33 +0000)]
DivergencyAnalysis patch for review
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305494
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 15 Jun 2017 19:09:51 +0000 (19:09 +0000)]
[InstCombine] Make the context instruction parameter of foldOrOfICmps a reference to discourage passing nullptr and to remove the '&' from all of the call sites. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305493
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 15 Jun 2017 18:56:05 +0000 (18:56 +0000)]
[InstCombine] Pre-commit test cases for the transform proposed in D34244.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305492
91177308-0d34-0410-b5e6-
96231b3b80d8
Lei Huang [Thu, 15 Jun 2017 18:29:59 +0000 (18:29 +0000)]
[MachineLICM] Hoist TOC-based address instructions
Add condition for MachineLICM to safely hoist instructions that utilize
non constant registers that are reserved.
On PPC, global variable access is done through the table of contents (TOC)
which is always in register X2. The ABI reserves this register in any
functions that have calls or access global variables.
A call through a function pointer involves saving, changing and restoring
this register around the call and thus MachineLICM does not consider it to
be invariant. We can however guarantee the register is preserved across the
call and thus is invariant.
Differential Revision: https://reviews.llvm.org/D33562
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305490
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 15 Jun 2017 17:58:24 +0000 (17:58 +0000)]
Fold variable into assert.
Silences an unused variable warning in Release builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305488
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 15 Jun 2017 17:55:20 +0000 (17:55 +0000)]
[InstCombine] Handle (iszero(A & K1) | iszero(A & K2)) -> (A & (K1 | K2)) != (K1 | K2) when the one of the Ands is commuted relative to the other
Currently we expect A to be on the same side in both Ands but nothing guarantees that.
While there also switch to using matchers for some of the code.
Differential Revision: https://reviews.llvm.org/D34230
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305487
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 15 Jun 2017 17:41:32 +0000 (17:41 +0000)]
Silence warning with assertions disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305485
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnold Schwaighofer [Thu, 15 Jun 2017 17:34:42 +0000 (17:34 +0000)]
ISel: Fix FastISel of swifterror values
The code assumed that we process instructions in basic block order. FastISel
processes instructions in reverse basic block order. We need to pre-assign
virtual registers before selecting otherwise we get def-use relationships wrong.
This only affects code with swifterror registers.
rdar://
32659327
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305484
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 15 Jun 2017 17:27:56 +0000 (17:27 +0000)]
[BasicAA] Add test case that goes with r305481.
Forgot to 'git add' the file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305483
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 15 Jun 2017 17:26:13 +0000 (17:26 +0000)]
Apply summary-based dead stripping to regular LTO modules with summaries.
If a regular LTO module has a summary index, then instead of linking
it into the combined regular LTO module right away, add it to the
combined summary index and associate it with a special module that
represents the combined regular LTO module.
Any such modules are linked during LTO::run(), at which time we use
the results of summary-based dead stripping to control whether to
link prevailing symbols.
Differential Revision: https://reviews.llvm.org/D33922
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305482
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 15 Jun 2017 17:16:56 +0000 (17:16 +0000)]
[BasicAA] Don't call isKnownNonEqual if we might be have gone through a PHINode.
This is a fix for the test case in PR32314.
Basic Alias Analysis can ask if two nodes are known non-equal after looking through a phi node to find a GEP. isAddOfNonZero saw an add of a constant from the same phi and said that its output couldn't be equal. But Basic Alias Analysis was really asking about the value from the previous loop iteration.
This patch at least makes that case not happen anymore, I'm not sure if there were still other ways this can fail. As was discussed in the bug, it looks like fixing BasicAA would be difficult so this patch seemed like a possible workaround
Differential Revision: https://reviews.llvm.org/D33136
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305481
91177308-0d34-0410-b5e6-
96231b3b80d8
Hiroshi Inoue [Thu, 15 Jun 2017 16:51:28 +0000 (16:51 +0000)]
[PowerPC] fix potential verification errors on CFENCE8
This patch fixes a potential verification error (64-bit register operands for cmpw) with -verify-machineinstrs.
Differential Revision: https://reviews.llvm.org/D34208
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305479
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Dardis [Thu, 15 Jun 2017 16:28:28 +0000 (16:28 +0000)]
[mips] Fix documentation of member variable. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305478
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Thu, 15 Jun 2017 16:27:49 +0000 (16:27 +0000)]
[DAG] As StoreMerge now generates only legal nodes remove unecessary guard when run post-legalization NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305477
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 15 Jun 2017 16:20:27 +0000 (16:20 +0000)]
Remove trailing whitespace. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305476
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Thu, 15 Jun 2017 15:57:12 +0000 (15:57 +0000)]
[Doc] Document prof metadata in LangRef
Summary:
Points to existing documentation for branch_weights and
function_entry_count, and adds an example for VP value profile metadata.
Reviewers: davidxl, reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34218
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305475
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 15 Jun 2017 15:13:19 +0000 (15:13 +0000)]
[InstCombine] auto-generate complete checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305474
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Thu, 15 Jun 2017 15:05:48 +0000 (15:05 +0000)]
[DAG] Defer Pre/Post IndexStore merge to after mergestore. NFCI.
In preparation for doing storemerge post-legalization, reorder
visitSTORE passes to move pre/post-index combining after store
merge. Reordered passes other than store merge are unaffected.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305473
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 15 Jun 2017 14:52:30 +0000 (14:52 +0000)]
[X86][AVX2] Fix issue in lowerV8I16GeneralSingleInputVectorShuffle that was assuming v8i16 vectors
We can use this with v16i16/v32i16 as well.
Found during fuzz testing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305472
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Thu, 15 Jun 2017 14:47:44 +0000 (14:47 +0000)]
[AArch64] Add indexed check to splitStores. NFC.
Add explicit check for unhandled cases in preparation for delaying
splitStores to post-legalization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305471
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 15 Jun 2017 14:39:34 +0000 (14:39 +0000)]
Revert r305465: [X86][AVX512] Improve lowering of AVX512 compare intrinsics (remove redundant shift left+right instructions).
This is causing windows buildbot failures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305470
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Thu, 15 Jun 2017 14:04:07 +0000 (14:04 +0000)]
[DAG] Allow truncated and extend memory operations in Store Merge. NFCI.
As all store merges checks are based on the memory operation
performed, allow use of truncated stores and extended loads as valid
input candidates for merging.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305468
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Thu, 15 Jun 2017 13:34:54 +0000 (13:34 +0000)]
[DAG] Make MergeStores generate legalized stores. NFCI.
Realized merged stores as truncstores if store will be realized as
such by legalization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305467
91177308-0d34-0410-b5e6-
96231b3b80d8