We have a logic that adds a few sections implicitly.
Though the SHT_NULL section with section number 0
is an exception.
In D64913 I want to teach yaml2obj to redefine the null section.
And in this patch I add it to the sections list,
to make it kind of a regular section.
Differential revision: https://reviews.llvm.org/D65087
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366785 91177308-0d34-0410-b5e6-96231b3b80d8
The function was calling getNode() on an SDValue to return and the
caller turned the result back into a SDValue. So just return the
original SDValue to avoid this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366779 91177308-0d34-0410-b5e6-96231b3b80d8
Summary: Adds a binding to the internalize pass that allows the caller to pass a function pointer that acts as the visibility-preservation predicate. Previously, one could only pass an unsigned value (not LLVMBool?) that directed the pass to consider "main" or not.
Reviewers: whitequark, deadalnix, harlanhaskins
Reviewed By: whitequark, harlanhaskins
Subscribers: kren1, hiraditya, llvm-commits, harlanhaskins
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62456
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366777 91177308-0d34-0410-b5e6-96231b3b80d8
Replace float load/store pair with integer load/store pair when it's only used in load/store,
because float load/store instructions cost more cycles then integer load/store.
A typical scenario is when there is a call with more than 13 float arguments passing, we need pass them by stack.
So we need a load/store pair to do such memory operation if the variable is global variable.
Differential Revision: https://reviews.llvm.org/D64195
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366775 91177308-0d34-0410-b5e6-96231b3b80d8
MFI is no longer just needed for an assert. Move it out of the debug only
section to allow non-assert builds to be able to find it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366773 91177308-0d34-0410-b5e6-96231b3b80d8
[Attributor] Liveness analysis.
Liveness analysis abstract attribute used to indicate which BasicBlocks are dead and can therefore be ignored.
Right now we are only looking at noreturn calls.
Reviewers: jdoerfert, uenoku
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D64162
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366769 91177308-0d34-0410-b5e6-96231b3b80d8
We were silently using the ABI alignment for all of the stores generated for deopt and gc values. We'd gotten the alignment of the stack slot itself properly reduced (via MachineFrameInfo's clamping), but having the MMO on the store incorrect was enough for us to generate an aligned store to a unaligned location.
The simplest fix would have been to just pass the alignment to the helper function, but once we do that, the helper function doesn't really help. So, inline it and directly call the MMO version of DAG.getStore with a properly constructed MMO.
Note that there's a separate performance possibility here. Even if we *can* realign stacks, we probably don't *want to* if all of the stores are in slowpaths. But that's a later patch, if at all. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366765 91177308-0d34-0410-b5e6-96231b3b80d8
This patch exnteds the error handling in the debug line parser to get
rid of the existing MD5 assertion. I want to reuse the debug line parser
from LLVM in LLDB where we cannot crash on invalid input.
Differential revision: https://reviews.llvm.org/D64544
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366762 91177308-0d34-0410-b5e6-96231b3b80d8
It is not safe in general to replace an alias in a GEP with its aliasee
if the alias can be replaced with another definition (i.e. via strong/weak
resolution (linkonce_odr) or via symbol interposition (default visibility
in ELF)) while the aliasee cannot. An example of how this can go wrong is
in the included test case.
I was concerned that this might be a load-bearing misoptimization (it's
possible for us to use aliases to share vtables between base and derived
classes, and on Windows, vtable symbols will always be aliases in RTTI
mode, so this change could theoretically inhibit trivial devirtualization
in some cases), so I built Chromium for Linux and Windows with and without
this change. The file sizes of the resulting binaries were identical, so it
doesn't look like this is going to be a problem.
Differential Revision: https://reviews.llvm.org/D65118
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366754 91177308-0d34-0410-b5e6-96231b3b80d8
[Attributor] Liveness analysis.
Liveness analysis abstract attribute used to indicate which BasicBlocks are dead and can therefore be ignored.
Right now we are only looking at noreturn calls.
Reviewers: jdoerfert, uenoku
Subscribers: hiraditya, llvm-commits
Differential revision: https://reviews.llvm.org/D64162
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366753 91177308-0d34-0410-b5e6-96231b3b80d8
These may remain after @llvm.umul.with.overflow was canonicalized
from the code that was originally doing the check via division.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366751 91177308-0d34-0410-b5e6-96231b3b80d8
This comes up in JPEG decoding, see e.g.
Figure F.12 – Extending the sign bit of a decoded value in V
of ITU T.81 (JPEG specification).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366750 91177308-0d34-0410-b5e6-96231b3b80d8
Even if we formed @llvm.umul.with.overflow, we are still stuck
with that guard against div-by-zero, which is no longer needed,
because we didn't flatten the CFG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366749 91177308-0d34-0410-b5e6-96231b3b80d8
While we can form the @llvm.mul.with.overflow easily,
we are still left with that check that was guarding against div-by-0.
And in the second case we won't even flatten the CFG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366747 91177308-0d34-0410-b5e6-96231b3b80d8
The xform has no real valuewhen it's using out of a complex pattern
output. The complex pattern was already creating TargetConstants with
i16, so this was just unnecessary machinery.
This allows global isel to import the simple cases once the complex
pattern is implemented.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366743 91177308-0d34-0410-b5e6-96231b3b80d8
Liveness analysis abstract attribute used to indicate which BasicBlocks are dead and can therefore be ignored.
Right now we are only looking at noreturn calls.
Reviewers: jdoerfert, uenoku
Subscribers: hiraditya, llvm-commits
Differential revision: https://reviews.llvm.org/D64162
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366736 91177308-0d34-0410-b5e6-96231b3b80d8
The build_vector will become a constant pool load. By using the
desired type initially, it ensures we don't generate a bitcast
of the constant pool load which will need to be folded with
the load.
While experimenting with another patch, I noticed that when the
load type and the constant pool type don't match, then
SimplifyDemandedBits can't handle it. While we should probably
fix that, this was a simple way to fix the issue I saw.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366732 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
Since we are planning to add ADDIStocHA for 32bit in later patch, we decided
to change 64bit one first to follow naming convention with 8 behind opcode.
Patch by: Xiangling_L
Differential Revision: https://reviews.llvm.org/D64814
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366731 91177308-0d34-0410-b5e6-96231b3b80d8
Porting function return value attribute noalias to attributor.
This will be followed with a patch for callsite and function argumets.
Reviewers: jdoerfert
Subscribers: lebedev.ri, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D63067
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366728 91177308-0d34-0410-b5e6-96231b3b80d8
Stubs out a TargetLoweringObjectFileXCOFF class, implementing only
SelectSectionForGlobal for common symbols. Also adds an override of
EmitGlobalVariable in PPCAIXAsmPrinter which adds a number of defensive errors
and adds support for emitting common globals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366727 91177308-0d34-0410-b5e6-96231b3b80d8
While debugging code that uses SafeStack, we've noticed that LLVM
produces an invalid DWARF. Concretely, in the following example:
int main(int argc, char* argv[]) {
std::string value = "";
printf("%s\n", value.c_str());
return 0;
}
DWARF would describe the value variable as being located at:
DW_OP_breg14 R14+0, DW_OP_deref, DW_OP_constu 0x20, DW_OP_minus
The assembly to get this variable is:
leaq -32(%r14), %rbx
The order of operations in the DWARF symbols is incorrect in this case.
Specifically, the deref is incorrect; this appears to be incorrectly
re-inserted in repalceOneDbgValueForAlloca.
With this change which inserts the deref after the offset instead of
before it, LLVM produces correct DWARF:
DW_OP_breg14 R14-32
Differential Revision: https://reviews.llvm.org/D64971
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366726 91177308-0d34-0410-b5e6-96231b3b80d8
The bytes inserted before an overaligned global need to be padded according
to the alignment set on the original global in order for the initializer
to meet the global's alignment requirements. The previous implementation
that padded to the pointer width happened to be correct for vtables on most
platforms but may do the wrong thing if the vtable has a larger alignment.
This issue is visible with a prototype implementation of HWASAN for globals,
which will overalign all globals including vtables to 16 bytes.
There is also no padding requirement for the bytes inserted after the global
because they are never read from nor are they significant for alignment
purposes, so stop inserting padding there.
Differential Revision: https://reviews.llvm.org/D65031
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366725 91177308-0d34-0410-b5e6-96231b3b80d8
We were previously ignoring alignment entirely when combining globals
together in this pass. There are two main things that we need to do here:
add additional padding before each global to meet the alignment requirements,
and set the combined global's alignment to the maximum of all of the original
globals' alignments.
Since we now need to calculate layout as we go anyway, use the calculated
layout to produce GlobalLayout instead of using StructLayout.
Differential Revision: https://reviews.llvm.org/D65033
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366722 91177308-0d34-0410-b5e6-96231b3b80d8
This reverts commit r366686 as it appears to be causing buildbot
failures on sanitizer-x86_64-linux-android and sanitizer-x86_64-linux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366708 91177308-0d34-0410-b5e6-96231b3b80d8
This was truncating register value that didn't fit in unsigned char.
Switch AMDGPU sendmsg intrinsics to using a tablegen pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366695 91177308-0d34-0410-b5e6-96231b3b80d8
ARMLowOverheadLoops would assert a failure if it did not find all the
pseudo instructions that comprise the hardware loop. Instead of doing
this, iterate through all the instructions of the function and revert
any remaining pseudo instructions that haven't been converted.
Differential Revision: https://reviews.llvm.org/D65080
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366691 91177308-0d34-0410-b5e6-96231b3b80d8
This patch was not the reason of the buildbot failure.
Deleted code was introduced as a work around for a bug in the gold linker
(http://sourceware.org/PR16794). Test case that was given as a reason for
this part of code, the one on previous link, now works for the gold.
This condition is too strict and when a code is compiled with debug info
it forces generation of numerous relocations with symbol for architectures
that do not have relocation addend.
Reviewers: arsenm, espindola
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D64327
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366686 91177308-0d34-0410-b5e6-96231b3b80d8
This patch enables us to find the source loads for each element, splitting them into a Load and ByteOffset, and attempts to recognise consecutive loads that are in fact from the same source load.
A helper function, findEltLoadSrc, recurses to find a LoadSDNode and determines the element's byte offset within it. When attempting to match consecutive loads, byte offsetted loads then attempt to matched against a previous load that has already been confirmed to be a consecutive match.
Next step towards PR16739 - after this we just need to account for shuffling/repeated elements to create a vector load + shuffle.
Fixed out of bounds load assert identified in rL366501
Differential Revision: https://reviews.llvm.org/D64551
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366681 91177308-0d34-0410-b5e6-96231b3b80d8