-
Notifications
You must be signed in to change notification settings - Fork 112
Conversation
…only code." This reverts commit 3a204fa. I've upset a buildbot which runs the address sanitizer: ERROR: AddressSanitizer: stack-use-after-scope lib/Target/ARM/ARMISelLowering.cpp:2690 That Twine variable is used illegally. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305390 91177308-0d34-0410-b5e6-96231b3b80d8
This was originally reverted because of some non-deterministic failures on certain buildbots. Luckily ASAN eventually caught this as a stack-use-after-scope, so the fix is included in this patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305393 91177308-0d34-0410-b5e6-96231b3b80d8
Many times unit tests for different libraries would like to use the same helper functions for checking common types of errors. This patch adds a common library with helpers for testing things in Support, and introduces helpers in here for integrating the llvm::Error and llvm::Expected<T> classes with gtest and gmock. Normally, we would just be able to write: EXPECT_THAT(someFunction(), succeeded()); but due to some quirks in llvm::Error's move semantics, gmock doesn't make this easy, so two macros EXPECT_THAT_ERROR() and EXPECT_THAT_EXPECTED() are introduced to gloss over the difficulties. Consider this an exception, and possibly only temporary as we look for ways to improve this. Differential Revision: https://reviews.llvm.org/D33059 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305395 91177308-0d34-0410-b5e6-96231b3b80d8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305396 91177308-0d34-0410-b5e6-96231b3b80d8
We know that shuffle masks are power-of-2 sizes, but there's no way (?) for LLVM to know that, so hack combineX86ShufflesRecursively() to be much faster by replacing div/rem with shift/mask. This makes the motivating compile-time bug in PR32037 ( https://bugs.llvm.org/show_bug.cgi?id=32037 ) about 9% faster overall. Differential Revision: https://reviews.llvm.org/D34174 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305398 91177308-0d34-0410-b5e6-96231b3b80d8
…work with non power of 2 bit widths There's an early out that's trying to detect when we don't know any bits that make up the legal range of a shift. The code subtracts one from BitWidth which creates a mask in the lower bits for power of 2 bit widths. This is then ANDed with the known bits to see if any of those bits are known. If the bit width isn't a power of 2 this creates a non-sensical mask. This patch corrects this by rounding up to a power of 2 before doing the subtract and mask. Differential Revision: https://reviews.llvm.org/D34165 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305400 91177308-0d34-0410-b5e6-96231b3b80d8
Modified a comment to confirm commit access functionality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305402 91177308-0d34-0410-b5e6-96231b3b80d8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305403 91177308-0d34-0410-b5e6-96231b3b80d8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305405 91177308-0d34-0410-b5e6-96231b3b80d8
This is part of the ODR checker proposal: http://lists.llvm.org/pipermail/llvm-dev/2017-June/113820.html Per discussion on the gnu-gabi mailing list [1] the section type range 0x6fff4c00..0x6fff4cff is reserved for LLVM. [1] https://sourceware.org/ml/gnu-gabi/2017-q2/msg00030.html Differential Revision: https://reviews.llvm.org/D33978 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305407 91177308-0d34-0410-b5e6-96231b3b80d8
Summary: Make DebugCounter::print and dump methods to be const correct. Reviewers: aprantl Reviewed By: aprantl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34214 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305408 91177308-0d34-0410-b5e6-96231b3b80d8
This way we end up not looking at PHI args already removed. MemSSA now goes through the updater so we can prune it to avoid having redundant MemoryPHI arguments, but that doesn't quite work for the general case. Discussed with Daniel Berlin, fixes PR33406. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305409 91177308-0d34-0410-b5e6-96231b3b80d8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305411 91177308-0d34-0410-b5e6-96231b3b80d8
Summary: At present, `-profile-guided-section-prefix` is a `cl::Optional` option, which means it demands to be passed exactly zero or one times. Our build system makes it pretty tricky to guarantee this. We often accidentally pass the flag more than once (but always with the same "false" value) which results in an error, after which compilation fails: ``` clang (LLVM option parsing): for the -profile-guided-section-prefix option: may only occur zero or one times! ``` While we work on improving our build system, it also seems reasonable just to allow `-profile-guided-section-prefix` to be passed more than once, by to `cl::ZeroOrMore`. Quoting [[ http://llvm.org/docs/CommandLine.html#controlling-the-number-of-occurrences-required-and-allowed | the documentation ]]: > The cl::ZeroOrMore modifier ... indicates that your program will allow the option to be specified zero or more times. > ... > If an option is specified multiple times for an option of the cl::opt class, only the last value will be retained. Reviewers: danielcdh Reviewed By: danielcdh Subscribers: twoh, david2050, llvm-commits Differential Revision: https://reviews.llvm.org/D34219 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305413 91177308-0d34-0410-b5e6-96231b3b80d8
…ively() This is a follow-up to https://reviews.llvm.org/D34174 / https://reviews.llvm.org/rL305398. We mentioned replacing the multiplies with shifts, but the real win seems to be in bypassing the extra ops in the common case when the RootRatio and OpRatio are one. This gives us another 1-2% overall win for the test in PR32037: https://bugs.llvm.org/show_bug.cgi?id=32037 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305414 91177308-0d34-0410-b5e6-96231b3b80d8
…ntly due to other limitations, i believe. This also means i can't make a test for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305415 91177308-0d34-0410-b5e6-96231b3b80d8
…h jumps to the same target regardless of condition git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305416 91177308-0d34-0410-b5e6-96231b3b80d8
…-using and Include What You Use warnings; other minor fixes (NFC). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305419 91177308-0d34-0410-b5e6-96231b3b80d8
Instead use target_link_libraries directly. Thanks to Juergen Ributzka for the suggestion, which fixes an issue when llvm is configured with no targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305421 91177308-0d34-0410-b5e6-96231b3b80d8
The current name (addModulePath) and return value (ModulePathStringTableTy::iterator) is a little confusing. This API adds a module, not just a path. And the iterator is basically just an implementation detail of the summary index. Address both of those issues by renaming to addModule and introducing a ModuleSummaryIndex::ModuleInfo type that the function returns. Differential Revision: https://reviews.llvm.org/D34124 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305422 91177308-0d34-0410-b5e6-96231b3b80d8
On Darwin, section names have a 16char length limit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305429 91177308-0d34-0410-b5e6-96231b3b80d8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305430 91177308-0d34-0410-b5e6-96231b3b80d8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305431 91177308-0d34-0410-b5e6-96231b3b80d8
…tially commuted IR. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305438 91177308-0d34-0410-b5e6-96231b3b80d8
Previously if you used fmt_align(7, Center) you would get the output ' 7 '. It may be desirable for the user to specify the fill character though, for example producing '---7---'. This patch adds that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305449 91177308-0d34-0410-b5e6-96231b3b80d8
…UR1SP Author: milena.vujosevic.janicic Reviewers: sdardis The patch extends size reduction pass for MicroMIPS. The following instructions are examined and transformed, if possible: ADDIU instruction is transformed into 16-bit instruction ADDIUSP ADDIU instruction is transformed into 16-bit instruction ADDIUR1SP Differential Revision: https://reviews.llvm.org/D33887 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305455 91177308-0d34-0410-b5e6-96231b3b80d8
Summary: Scheduling AESE/AESMC and AESD/AESIMC instruction pairs back-to-back gives a double digit speedup on benchmarks using those instructions on Cortex-A processors. In GCC, this optimization is part of the generic processor model as well. This change should not have a major performance impact on processors that do not optimize AES instruction pairs, although I only had access to Cortex-A processors for benchmarking. Reviewers: rengolin, kristof.beyls, javed.absar, evandro, silviu.baranga, MatzeB, mcrosier, joelkevinjones, joel_k_jones, bmakam, t.p.northover Reviewed By: evandro Subscribers: sbaranga, aemerson, llvm-commits Differential Revision: https://reviews.llvm.org/D33836 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305457 91177308-0d34-0410-b5e6-96231b3b80d8
Lowering mixed struct args, params and returns used G_INSERT, which is a bit more convoluted to support through the entire pipeline. Since they don't occur that often in practice, it's probably wiser to leave them out until later. Meanwhile, we can lower homogeneous structs using G_MERGE_VALUES, which has good support in the legalizer. These occur e.g. as the return of __aeabi_idivmod, so it's nice to be able to support them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305458 91177308-0d34-0410-b5e6-96231b3b80d8
Add support for modulo for targets that have hardware division and for those that don't. When hardware division is not available, we have to choose the correct libcall to use. This is generally straightforward, except for AEABI. The AEABI variant is trickier than the other libcalls because it returns { quotient, remainder }, instead of just one value like the other libcalls that we've seen so far. Therefore, we need to use custom lowering for it. However, we don't want to have too much special code, so we refactor the target-independent code in the legalizer by adding a helper for replacing an instruction with a libcall. This helper is used by the legalizer itself when dealing with simple calls, and also by the custom ARM legalization for the more complicated AEABI divmod calls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305459 91177308-0d34-0410-b5e6-96231b3b80d8
This is a fix for PR33292 that shows a case of extremely long compilation of a single .c file with clang, with most time spent within SCEV. We have a mechanism of limiting recursion depth for getAddExpr to avoid long analysis in SCEV. However, there are calls from getAddExpr to getMulExpr and back that do not propagate the info about depth. As result of this, a chain getAddExpr -> ... .> getAddExpr -> getMulExpr -> getAddExpr -> ... -> getAddExpr can be extremely long, with every segment of getAddExpr's being up to max depth long. This leads either to long compilation or crash by stack overflow. We face this situation while analyzing big SCEVs in the test of PR33292. This patch applies the same limit on max expression depth for getAddExpr and getMulExpr. Differential Revision: https://reviews.llvm.org/D33984 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305463 91177308-0d34-0410-b5e6-96231b3b80d8
# Conflicts: # cmake/config-ix.cmake # include/llvm/Analysis/AssumptionCache.h # include/llvm/InitializePasses.h # lib/Analysis/AssumptionCache.cpp # lib/Transforms/Scalar/NewGVN.cpp # test/Transforms/NewGVN/pr31613.ll # tools/llvm-xray/xray-account.cc
…32/f64 intrinsics
All PR branches are now updated: and all tests should pass. Ran all core suite variants and |
I'll start to review now, great. |
In particular check out the three commits shown above in this GitHub view, those are my changes, the first one is a "stock" merge with only merge conflicts resolved, but no other changes. |
@@ -190,7 +190,7 @@ static bool ExpandVarArgCall(Module *M, InstType *Call, DataLayout *DL) { | |||
for (unsigned I = 0, E = FuncType->getNumParams(); I < E; ++I) { | |||
FixedArgs.push_back(Call->getArgOperand(I)); | |||
// AttributeSets use 1-based indexing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this another case of the off-by-one issue that you just fixed in ExpandByVal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a good question. I don't actually understand where that off by one issue comes from, and what exactly changed so that I had to do that change in ExpandByVal. I did that change in ExpandByVal because I saw in test code that the expansion by value was getting applied to parameters "off by one" in the generated JS code. It may be the case that this + 1 needs to be removed, or then not. In the current branch all tests pass, so I don't want to just remove the + 1 here without understanding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gives me low confidence in the +1 removal change. I think we need to understand this better.
How about asking for help from Rust people, which they offered in the other PR? Many of them are LLVM experts. Perhaps they can give a quick and clear response on changes to the Attribute API changes in 4.0.1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I am reading the changes, but I don't know who would be a good person to review this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can ask where the Rust people offered to help, in the 5.0 PR I think it was.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, commented in #199 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upon further inspection, it looks like the answer to this is yes.
const DataLayout &DL, | ||
const AttributeSet From, | ||
const AttributeList From, | ||
const unsigned OldArg, Type *NewArgTy, | ||
const unsigned RetIndex) { | ||
const unsigned NewIndex = RetIndex + OldArg + 1; | ||
if (!NewArgTy) { | ||
const unsigned OldIndex = OldArg + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
Also ran the |
Now I understand where the discrepancy comes from. The Rerunning all tests after the above changes, and I'll push an updated version shortly. |
Updated with the corrected |
…o use 0-based indexing instead of 1-based indexing.
Thanks! Looks good. It does appear that |
if (isIllegal(AI->getType())) { | ||
j++; | ||
continue; | ||
} | ||
if (!Attrs.hasAttributes(i)) continue; | ||
if (!Attrs.hasAttributes(i+1)) continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be hasParamAttribute(i)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check
Ok, did a new pass on this, bringing all three branches up to date with latest, and reran default and other suites, which still pass, except for
I can make these two tests pass with diff --git a/test/CodeGen/JS/allocamanager-phis.ll b/test/CodeGen/JS/allocamanager-phis.ll
index c04a212..71d5737 100644
--- a/test/CodeGen/JS/allocamanager-phis.ll
+++ b/test/CodeGen/JS/allocamanager-phis.ll
@@ -6,9 +6,9 @@
; an overlapping lifetime with l_766.i which is only visible if we can
; see through phis.
-; CHECK: $vararg_buffer3 = sp;
-; CHECK: $l_1565$i = sp + 16|0;
-; CHECK: $l_766$i = sp + 12|0;
+; CHECK: $vararg_buffer3 = sp + 16|0;
+; CHECK: $l_1565$i = sp + 36|0;
+; CHECK: $l_767$i = sp + 32|0;
target datalayout = "e-p:32:32-i64:64-v128:32:128-n32-S128"
target triple = "asmjs-unknown-emscripten"
diff --git a/test/CodeGen/JS/allocamanager.ll b/test/CodeGen/JS/allocamanager.ll
index 19f1ca7..d8346ab 100644
--- a/test/CodeGen/JS/allocamanager.ll
+++ b/test/CodeGen/JS/allocamanager.ll
@@ -16,11 +16,9 @@ target triple = "asmjs-unknown-emscripten"
@.str3 = private unnamed_addr constant [43 x i8] c"another message from the program: \22%s\22...\0A\00", align 1
; CHECK: function _foo($argc,$argv) {
-; CHECK-NOT: cupcake
-; CHECK: STACKTOP = STACKTOP + 128|0;
+; CHECK: STACKTOP = STACKTOP + 272|0;
; CHECK-NEXT: vararg_buffer0 =
-; CHECK-NEXT: $muffin =
-; CHECK-NOT: cupcake
+; CHECK: $muffin =
; CHECK: }
; Function Attrs: nounwind
@@ -73,11 +71,8 @@ entry:
}
; CHECK: function _bar($argc,$argv) {
-; CHECK-NOT: cupcake
-; CHECK: STACKTOP = STACKTOP + 128|0;
+; CHECK: STACKTOP = STACKTOP + 272|0;
; CHECK-NEXT: vararg_buffer0 =
-; CHECK-NEXT: $muffin =
-; CHECK-NOT: cupcake
; CHECK: }
; Function Attrs: nounwind but that doesn't obviously look good. For the first test Apart from this failure, all other tests are passing ok. |
I'm not that familiar with the AllocaManager code. @sunfishcode, you wrote it, any thoughts on what @juj is seeing above? |
… "llvm.lifetime/invariant.start/end.p0i8" to follow the intrinsics name change llvm-mirror/llvm@bdbe828 .
The above commit fixes the AllocaManager test failures. Tested that the core and other suites now pass, so this is good to land based on everything I'm seeing. @kripken : have we ever updated LLVM without also updating Emscripten minor version? I.e. should we do a 1.38.0 out of this, or a 1.37.30? |
In that file, I see I went with having both variants: DEF_CALL_HANDLER(llvm_lifetime_start, {
return "";
})
DEF_CALL_HANDLER(llvm_lifetime_end, {
return "";
})
DEF_CALL_HANDLER(llvm_lifetime_start_p0i8, {
return "";
})
DEF_CALL_HANDLER(llvm_lifetime_end_p0i8, {
return "";
})
DEF_CALL_HANDLER(llvm_invariant_start, {
return "";
})
DEF_CALL_HANDLER(llvm_invariant_end, {
return "";
})
DEF_CALL_HANDLER(llvm_invariant_start_p0i8, {
return "";
})
DEF_CALL_HANDLER(llvm_invariant_end_p0i8, {
return "";
}) this allows building code coming from old .bc files, I think. |
I would also check What we've done in the past is tag a minor version before and after. So |
Checked through |
That's ok, you can merge this. I'll run the sanity tests later, almost certainly any issue there is unrelated to LLVM changes. |
Perfect, tagging and merging and tagging now.. |
No description provided.