| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These extra flags are not required to properly order the atomic
load/store instructions. SelectionDAGBuilder chains atomics as if they
were volatile, and SelectionDAG::getAtomic() sets the isVolatile bit on
the memory operands of all atomic operations.
The volatile bit is enough to order atomic loads and stores during and
after SelectionDAG.
This means we set mayLoad on atomic_load, mayStore on atomic_store, and
mayLoad+mayStore on the remaining atomic read-modify-write operations.
llvm-svn: 162733
|
| |
|
|
|
|
|
|
|
| |
In SelectionDAGLegalize::ExpandLegalINT_TO_FP, expand INT_TO_FP nodes without
using any f64 operations if f64 is not a legal type.
Patch by Stefan Kristiansson.
llvm-svn: 162728
|
| |
|
|
|
|
| |
Reviewed offline by chandlerc.
llvm-svn: 162623
|
| |
|
|
|
|
|
| |
It is legal to have a register node as an explicit operand, it shouldn't
be counted as an implicit use.
llvm-svn: 162591
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
the case of multiple edges from one block to another.
A simple example is a switch statement with multiple values to the same
destination. The definition of an edge is modified from a pair of blocks to
a pair of PredBlock and an index into the successors.
Also set the weight correctly when building SelectionDAG from LLVM IR,
especially when converting a Switch.
IntegersSubsetMapping is updated to calculate the weight for each cluster.
llvm-svn: 162572
|
| |
|
|
|
|
| |
approach. We need to insert some valid TRANCATE node here.
llvm-svn: 162354
|
| |
|
|
|
|
| |
did getFunction()->getName(). Remove includes of Function.h that are no longer needed.
llvm-svn: 162347
|
| |
|
|
|
|
|
|
| |
SelectionDAG's 'init' has not been called when the SelectionDAGBuilder is
constructed (in SelectionDAGISel's constructor), so this was previously always
initialized with 0.
llvm-svn: 162333
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
IR that hasn't been through SimplifyCFG can look like this:
br i1 %b, label %r, label %r
Make sure we don't create duplicate Machine CFG edges in this case.
Fix the machine code verifier to accept conditional branches with a
single CFG edge.
llvm-svn: 162230
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The DAGCombiner tries to optimise a BUILD_VECTOR by checking if it
consists purely of get_vector_elts from one or two source vectors. If
so, it either makes a concat_vectors node or a shufflevector node.
However, it doesn't check the element type width of the underlying
vector, so if you have this sequence:
Node0: v4i16 = ...
Node1: i32 = extract_vector_elt Node0
Node2: i32 = extract_vector_elt Node0
Node3: v16i8 = BUILD_VECTOR Node1, Node2, ...
It will attempt to:
Node0: v4i16 = ...
NewNode1: v16i8 = concat_vectors Node0, ...
Where this is actually invalid because the element width is completely
different. This causes an assertion failure on DAG legalization stage.
Fix:
If output item type of BUILD_VECTOR differs from input item type.
Make concat_vectors based on input element type and then bitcast it to the output vector type. So the case described above will transformed to:
Node0: v4i16 = ...
NewNode1: v8i16 = concat_vectors Node0, ...
NewNode2: v16i8 = bitcast NewNode1
llvm-svn: 162195
|
| |
|
|
|
|
|
|
|
| |
operations
so other unexpected operations don't slip through. Based on patch by Logan Chien.
PR11786/PR13186.
llvm-svn: 162146
|
| |
|
|
|
|
| |
legalizer may call us with an overly large type.
llvm-svn: 162101
|
| |
|
|
|
|
| |
various rounding modes. Use this to implement SelectionDAG constant folding of FFLOOR, FCEIL, and FTRUNC.
llvm-svn: 161807
|
| |
|
|
|
|
|
| |
handle the cases where the memory value type was illegal.
PR 13111.
llvm-svn: 161565
|
| |
|
|
|
|
|
| |
This adds support for TargetIndex operands during isel. The meaning of
these (index, offset, flags) operands is entirely defined by the target.
llvm-svn: 161453
|
| |
|
|
|
|
|
|
|
| |
This patch is mostly just refactoring a bunch of copy-and-pasted code, but
it also adds a check that the call instructions are readnone or readonly.
That check was already present for sin, cos, sqrt, log2, and exp2 calls, but
it was missing for the rest of the builtins being handled in this code.
llvm-svn: 161282
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The previous change caused fast isel to not attempt handling any calls to
builtin functions. That included things like "printf" and caused some
noticable regressions in compile time. I wanted to avoid having fast isel
keep a separate list of functions that had to be kept in sync with what the
code in SelectionDAGBuilder.cpp was handling. I've resolved that here by
moving the list into TargetLibraryInfo. This is somewhat redundant in
SelectionDAGBuilder but it will ensure that we keep things consistent.
llvm-svn: 161263
|
| |
|
|
|
|
|
|
|
| |
I noticed that SelectionDAGBuilder::visitCall was missing a check for memcmp
in TargetLibraryInfo, so that it would use custom code for memcmp calls even
with -fno-builtin. I also had to add a new -disable-simplify-libcalls option
to llc so that I could write a test for this.
llvm-svn: 161262
|
| |
|
|
|
|
|
|
|
|
| |
Fast isel doesn't currently have support for translating builtin function
calls to target instructions. For embedded environments where the library
functions are not available, this is a matter of correctness and not
just optimization. Most of this patch is just arranging to make the
TargetLibraryInfo available in fast isel. <rdar://problem/12008746>
llvm-svn: 161232
|
| |
|
|
| |
llvm-svn: 161110
|
| |
|
|
| |
llvm-svn: 161061
|
| |
|
|
|
|
| |
to do so.
llvm-svn: 161053
|
| |
|
|
|
|
| |
loads from different x86 segments but the same address would get CSEd
llvm-svn: 160987
|
| |
|
|
| |
llvm-svn: 160791
|
| |
|
|
|
|
| |
release builds from crashing if code uses an intrinsic with an illegal type.
llvm-svn: 160661
|
| |
|
|
| |
llvm-svn: 160621
|
| |
|
|
|
|
|
|
|
|
| |
that do not support it (X86 does not lower select_cc).
PR: 13428
Together with Michael Kuperstein <michael.m.kuperstein@intel.com>
llvm-svn: 160619
|
| |
|
|
| |
llvm-svn: 160617
|
| |
|
|
|
|
| |
release builds from crashing if code uses an intrinsic with an illegal type. For instance 256-bit AVX intrinsics without having AVX enabled.
llvm-svn: 160616
|
| |
|
|
|
|
| |
No functionality change.
llvm-svn: 160501
|
| |
|
|
| |
llvm-svn: 160493
|
| |
|
|
| |
llvm-svn: 160475
|
| |
|
|
| |
llvm-svn: 160411
|
| |
|
|
|
|
| |
instcombine transformation.
llvm-svn: 160387
|
| |
|
|
| |
llvm-svn: 160372
|
| |
|
|
|
|
|
| |
When truncating a result of a vector that is split we need
to use the result of the split vector, and not re-split the dead node.
llvm-svn: 160357
|
| |
|
|
| |
llvm-svn: 160354
|
| |
|
|
| |
llvm-svn: 160350
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
large immediates. Add dag combine logic to recover in case the large
immediates doesn't fit in cmp immediate operand field.
int foo(unsigned long l) {
return (l>> 47) == 1;
}
we produce
%shr.mask = and i64 %l, -140737488355328
%cmp = icmp eq i64 %shr.mask, 140737488355328
%conv = zext i1 %cmp to i32
ret i32 %conv
which codegens to
movq $0xffff800000000000,%rax
andq %rdi,%rax
movq $0x0000800000000000,%rcx
cmpq %rcx,%rax
sete %al
movzbl %al,%eax
ret
TargetLowering::SimplifySetCC would transform
(X & -256) == 256 -> (X >> 8) == 1
if the immediate fails the isLegalICmpImmediate() test. For x86,
that's immediates which are not a signed 32-bit immediate.
Based on a patch by Eli Friedman.
PR10328
rdar://9758774
llvm-svn: 160346
|
| |
|
|
| |
llvm-svn: 160311
|
| |
|
|
|
|
|
|
|
|
|
| |
AssertZext value.
In the added testcase the constant 55 was behind an AssertZext of type i1, and ComputeDemandedBits
reported that some of the bits were both known to be one and known to be zero.
Together with Michael Kuperstein <michael.m.kuperstein@intel.com>
llvm-svn: 160305
|
| |
|
|
|
|
|
|
| |
wider than the output element type. Make sure to trunc them if needed.
Together with Michael Kuperstein <michael.m.kuperstein@intel.com>
llvm-svn: 160235
|
| |
|
|
|
|
|
|
|
| |
Add a micro-optimization to getNode of CONCAT_VECTORS when both operands are undefs.
Can't find a testcase for this because VECTOR_SHUFFLE already handles undef operands, but Duncan suggested that we add this.
Together with Michael Kuperstein <michael.m.kuperstein@intel.com>
llvm-svn: 160229
|
| |
|
|
|
|
|
|
| |
single undef.
The unoptimized concat_vectors isd prevented the canonicalization of the vector_shuffle node.
llvm-svn: 160221
|
| |
|
|
|
|
|
|
|
| |
When dumping the DAG for a fatal 'Cannot select' back-end error, also
provide the name of the function the construct is in. Useful when dealing
with large testcases, as the next step is to llvm-extract the function
in question to get a small(er) testcase.
llvm-svn: 160152
|
| |
|
|
|
|
|
|
|
| |
the input vector, it can be bigger (this is helpful for powerpc where <2 x i16>
is a legal vector type but i16 isn't a legal type, IIRC). However this wasn't
being taken into account by ExpandRes_EXTRACT_VECTOR_ELT, causing PR13220.
Lightly tweaked version of a patch by Michael Liao.
llvm-svn: 160116
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r1025 = s/zext r1024, 4
r1026 = extract_subreg r1025, 4
to a copy:
r1026 = copy r1024
This is correct. However it uses TII->isCoalescableExtInstr() which can return
true for instructions which essentially does a sext_in_reg so this can end up
with an illegal copy where the source and destination register classes do not
match. Add a check to avoid it. Sorry, no test case possible at this time.
rdar://11849816
llvm-svn: 160059
|
| |
|
|
|
|
|
|
| |
Ptr, etc.
No functionality change.
llvm-svn: 160042
|
| |
|
|
| |
llvm-svn: 160040
|
| |
|
|
|
|
|
| |
Load and Store nodes into their own functions.
No functional change.
llvm-svn: 160037
|