- Jun 17, 2017
-
-
NAKAMURA Takumi authored
[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 llvm-svn: 305632
-
Eric Christopher authored
llvm-svn: 305630
-
Eric Christopher authored
llvm-svn: 305629
-
Eric Christopher authored
llvm-svn: 305628
-
Eric Christopher authored
llvm-svn: 305627
-
Eric Christopher authored
llvm-svn: 305626
-
Matthias Braun authored
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 llvm-svn: 305625
-
Tim Shen authored
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 llvm-svn: 305624
-
Davide Italiano authored
The analysis is expected to be preserved by SelectionDAG. llvm-svn: 305621
-
Davide Italiano authored
Fixes PR33453. Differential Revision: https://reviews.llvm.org/D34303 llvm-svn: 305618
-
Zachary Turner authored
This was a regression introduced in a previous patch. Adding back the code that handles this case. llvm-svn: 305617
-
Sam Clegg authored
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 llvm-svn: 305616
-
Zachary Turner authored
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 llvm-svn: 305612
-
Zachary Turner authored
I'm trying to get rid of the TypeDatabase class, so the first step is to minimize its footprint. llvm-svn: 305611
-
Sam Clegg authored
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 llvm-svn: 305609
-
Yonghong Song authored
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> llvm-svn: 305608
-
Craig Topper authored
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 llvm-svn: 305607
-
Craig Topper authored
llvm-svn: 305606
-
Craig Topper authored
llvm-svn: 305605
-
Craig Topper authored
[TargetLowering] Use ConstantSDNode::isOne and getSExtValue instead of getting the underlying APInt first. NFC llvm-svn: 305604
-
Wei Mi authored
llvm-svn: 305603
-
Adrian Prantl authored
llvm-svn: 305602
-
Adrian Prantl authored
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 llvm-svn: 305599
-
Peter Collingbourne authored
llvm-svn: 305598
-
Spyridoula Gravani authored
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. llvm-svn: 305597
-
Eric Beckmann authored
llvm-svn: 305596
-
- Jun 16, 2017
-
-
Benjamin Kramer authored
Found by -Wpessimizing-move. llvm-svn: 305595
-
Eric Beckmann authored
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 llvm-svn: 305592
-
Anna Thomas authored
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 llvm-svn: 305591
-
Evgeniy Stepanov authored
This is a workaround for an ODR conflict with the definition in AMDGPUCodeObjectMetadata.cpp. llvm-svn: 305584
-
Davide Italiano authored
llvm-svn: 305583
-
Davide Italiano authored
llvm-svn: 305579
-
Wei Mi authored
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 llvm-svn: 305578
-
Davide Italiano authored
Whenever we don't know what to do with an instruction, we send it to overdefined anyway. llvm-svn: 305575
-
Spyridoula Gravani authored
llvm-svn: 305570
-
Matthias Braun authored
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. llvm-svn: 305566
-
Xinliang David Li authored
llvm-svn: 305564
-
Craig Topper authored
[InstCombine] Add test cases to show missed opportunities due to overly conservative single use checks. NFC llvm-svn: 305562
-
Yonghong Song authored
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> llvm-svn: 305560
-
Yonghong Song authored
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> llvm-svn: 305559
-