| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
This folds the compare emission into the select emission when possible, so we
can directly use the flags and don't have to emit a separate compare.
Related to rdar://problem/18960150.
llvm-svn: 221847
|
|
|
|
|
|
| |
Related to rdar://problem/18960150.
llvm-svn: 221846
|
|
|
|
|
|
|
|
| |
Lower the llvm.fabs intrinsic to the 'fabs' MI instruction.
This fixes rdar://problem/18946552.
llvm-svn: 221729
|
|
|
|
|
|
|
|
|
| |
In the case we optimize an integer extend away and replace it directly with the
source register, we also have to clear all kill flags at all its uses.
This is necessary, because the orignal IR instruction might be trivially dead,
but we replaced it with a nop at MI level.
llvm-svn: 221628
|
|
|
|
|
|
|
|
|
|
|
|
| |
check.
This is a minor change to use the immediate version when the operand is a null
value. This should get rid of an unnecessary 'mov' instruction in debug
builds and align the code more with the one generated by SelectionDAG.
This fixes rdar://problem/18785125.
llvm-svn: 220713
|
|
|
|
|
|
|
|
|
| |
Minor enhancement to use 'tbz' for i1 compare-and-branch to get rid of an 'and'
instruction.
This fixes rdar://problem/18784953.
llvm-svn: 220712
|
|
|
|
|
|
|
|
|
| |
The pattern matching for a 'ConstantInt' value was too restrictive. Checking for
a 'Constant' with a bull value is sufficient for using an 'cbz/cbnz' instruction.
This fixes rdar://problem/18784732.
llvm-svn: 220709
|
|
|
|
|
|
|
|
|
|
|
|
| |
instruction if it is in a different basic block.
This fixes a bug where the input register was not defined for the 'tbz/tbnz'
instruction. This happened, because we folded the 'and' instruction from a
different basic block.
This fixes rdar://problem/18784013.
llvm-svn: 220704
|
|
|
|
|
|
|
|
|
|
|
|
| |
At higher optimization levels the LLVM IR may contain more complex patterns for
loads/stores from/to frame indices. The 'computeAddress' function wasn't able to
handle this and triggered an assertion.
This fix extends the possible addressing modes for frame indices.
This fixes rdar://problem/18783298.
llvm-svn: 220700
|
|
|
|
|
|
|
|
|
|
| |
This fixes a miscompilation in the AArch64 fast-isel which was
triggered when a branch is based on an icmp with condition eq or ne,
and type i1, i8 or i16. The cbz instruction compares the whole 32-bit
register, so values with the bottom 1, 8 or 16 bits clear would cause
the wrong branch to be taken.
llvm-svn: 220553
|
|
|
|
|
|
|
|
|
|
|
| |
When the constant divisor was larger than 32bits, then the optimized code
generated for the AArch64 backend would emit the wrong code, because the shift
was defined as a shift of a 32bit constant '(1<<Lg2(divisor))' and we would
loose the upper 32bits.
This fixes rdar://problem/18678801.
llvm-svn: 219934
|
|
|
|
|
|
|
|
|
|
|
| |
This is mostly a copy of the existing FastISel GEP code, but we have to
duplicate it for AArch64, because otherwise we would bail out even for simple
cases. This is because the standard fastEmit functions don't cover MUL at all
and ADD is lowered very inefficientily.
The original commit had a bug in the add emit logic, which has been fixed.
llvm-svn: 219831
|
|
|
|
|
|
|
|
| |
function. NFC.
Simplify add with immediate emission by factoring it out into a helper function.
llvm-svn: 219830
|
|
|
|
|
|
| |
This breaks our internal build bots. Reverting it to get the bots green again.
llvm-svn: 219776
|
|
|
|
|
|
|
|
| |
This is mostly a copy of the existing FastISel GEP code, but on AArch64 we bail
out even for simple cases, because the standard fastEmit functions don't cover
MUL and ADD is lowered inefficientily.
llvm-svn: 219726
|
|
|
|
|
|
|
|
|
|
|
| |
Sign-/zero-extend folding depended on the load and the integer extend to be
both selected by FastISel. This cannot always be garantueed and SelectionDAG
might interfer. This commit adds additonal checks to load and integer extend
lowering to catch this.
Related to rdar://problem/18495928.
llvm-svn: 219716
|
|
|
|
|
|
|
|
|
|
| |
sign-/zero-extends.
The code already folds sign-/zero-extends, but only if they are arguments to
mul and shift instructions. This extends the code to also fold them when they
are direct inputs.
llvm-svn: 219187
|
|
|
|
|
|
|
| |
Tiny enhancement to the address computation code to also fold sub instructions
if the rhs is constant and can be folded into the offset.
llvm-svn: 219186
|
|
|
|
|
|
|
|
|
|
| |
This commit fixes an issue with sign-/zero-extending loads that was discovered
by Richard Barton.
We use now the correct load instructions for sign-extending loads to 64bit. Also
updated and added more unit tests.
llvm-svn: 219185
|
|
|
|
| |
llvm-svn: 219045
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Note: This version fixed an issue with the TBZ/TBNZ instructions that were
generated in FastISel. The issue was that the 64bit version of TBZ (TBZX)
automagically sets the upper bit of the immediate field that is used to specify
the bit we want to test. To test for any of the lower 32bits we have to first
extract the subregister and use the 32bit version of the TBZ instruction (TBZW).
Original commit message:
Teach selectBranch to fold bit test and branch into a single instruction (TBZ or
TBNZ).
llvm-svn: 218693
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The sign-/zero-extension of the loaded value can be performed by the memory
instruction for free. If the result of the load has only one use and the use is
a sign-/zero-extend, then we emit the proper load instruction. The extend is
only a register copy and will be optimized away later on.
Other instructions that consume the sign-/zero-extended value are also made
aware of this fact, so they don't fold the extend too.
This fixes rdar://problem/18495928.
llvm-svn: 218653
|
|
|
|
|
|
|
| |
Factor out the code that determines the implicit scale factor of memory
operations for a given value type.
llvm-svn: 218652
|
|
|
|
|
|
|
|
|
|
|
| |
for booleans (i1).
Shift-left immediate with sign-/zero-extensions also works for boolean values.
Update the assert and the test cases to reflect that fact.
This should fix a bug found by Chad.
llvm-svn: 218275
|
|
|
|
|
|
|
|
|
|
| |
When looking through sign/zero-extensions the code would always assume there is
such an extension instruction and use the wrong operand for the address.
There was also a minor issue in the handling of 'AND' instructions. I
accidentially used a 'cast' instead of a 'dyn_cast'.
llvm-svn: 218161
|
|
|
|
|
|
| |
Reverting it until I have time to investigate a regression.
llvm-svn: 218035
|
|
|
|
|
|
|
|
| |
When folding the intrinsic flag into the branch or select we also have to
consider the fact if the intrinsic got simplified, because it changes the
flag we have to check for.
llvm-svn: 218034
|
|
|
|
|
|
| |
Simplify {s|u}mul.with.overflow to {s|u}add.with.overflow when possible.
llvm-svn: 218033
|
|
|
|
| |
llvm-svn: 218032
|
|
|
|
|
|
|
|
|
|
|
|
| |
simplifying a memory address.
Small optimization in 'simplifyAddress'. When the offset cannot be encoded in
the load/store instruction, then we need to materialize the address manually.
The add instruction can encode a wider range of immediates than the load/store
instructions. This change tries to fold the offset into the add instruction
first before materializing the offset in a register.
llvm-svn: 218031
|
|
|
|
|
|
|
|
|
|
|
| |
The 'AND' instruction could be used to mask out the lower 32 bits of a register.
If this is done inside an address computation we might be able to fold the
instruction into the memory instruction itself.
and x1, x1, #0xffffffff ---> ldrb x0, [x0, w1, uxtw]
ldrb x0, [x0, x1]
llvm-svn: 218030
|
|
|
|
|
|
|
| |
Teach selectBranch to fold bit test and branch into a single instruction (TBZ or
TBNZ).
llvm-svn: 218010
|
|
|
|
|
|
|
|
|
| |
Emit an optimized instruction sequence for sdiv by power-of-2 depending on the
exact flag.
This fixes rdar://problem/18224511.
llvm-svn: 217986
|
|
|
|
|
|
| |
This is related to rdar://problem/18369687.
llvm-svn: 217980
|
|
|
|
|
|
|
|
|
| |
Try to fold the multiply into the add/sub or logical operations (when
possible).
This is related to rdar://problem/18369687.
llvm-svn: 217978
|
|
|
|
|
|
|
|
|
| |
Teach 'computeAddress' to also fold multiplies into the address computation
(when possible).
This fixes rdar://problem/18369443.
llvm-svn: 217977
|
|
|
|
|
|
|
|
|
| |
This takes advanatage of the CBZ and CBNZ instruction to further optimize the
common null check pattern into a single instruction.
This is related to rdar://problem/18358882.
llvm-svn: 217972
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds the last two missing floating-point condition codes (FCMP_UEQ and
FCMP_ONE) also to the branch selection. In these two cases an additonal branch
instruction is required.
This also adds unit tests to checks all the different condition codes.
This is related o rdar://problem/18358882.
llvm-svn: 217966
|
|
|
|
|
|
| |
Lower the first 8 vector arguments too.
llvm-svn: 217850
|
|
|
|
|
|
|
|
|
|
| |
little endian machines.
Allow handling of vectors during return lowering at least for little endian machines.
This was restricted in r208200 to fix it for big endian machines (according to
the comment), but it also disabled it for little endian too.
llvm-svn: 217846
|
|
|
|
|
|
| |
standard. NFC.
llvm-svn: 217845
|
|
|
|
| |
llvm-svn: 217840
|
|
|
|
|
|
|
|
| |
Also lower sin/cos/pow to runtime lib calls.
This fixes rdar://problem/18343468.
llvm-svn: 217839
|
|
|
|
|
|
|
|
|
|
|
| |
This lowers frem to a runtime libcall inside fast-isel.
The test case also checks the CallLoweringInfo bug that was exposed by this
change.
This fixes rdar://problem/18342783.
llvm-svn: 217833
|
|
|
|
|
|
|
|
| |
NFC.
Small refactor to tidy up the code a little.
llvm-svn: 217827
|
|
|
|
|
|
| |
Gets rid of isLoadStoreTypeLegal and replace it with isTypeSupported.
llvm-svn: 217826
|
|
|
|
|
|
|
|
| |
Add support for the last two missing fcmp condition codes: UEQ and ONE.
This fixes rdar://problem/18341575.
llvm-svn: 217823
|
|
|
|
|
|
|
|
|
| |
Extend the logical ops selection to also support non-native types such as i1,
i8, and i16.
Fixes rdar://problem/18330589.
llvm-svn: 217732
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
using static relocation model and small code model.
Summary: currently we generate GOT based relocations for weak symbol
references regardless of the underlying relocation model. This should
be change so that in static relocation model we use a constant pool
load instead.
Patch from: Keith Walker
Reviewers: Renato Golin, Tim Northover
llvm-svn: 217503
|
|
|
|
| |
llvm-svn: 217119
|