| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
llvm-svn: 161454
|
| |
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
An unsigned value converted to floating-point will always be greater than
a negative constant. Unfortunately InstCombine reversed the check so that
unsigned values were being optimized to always be greater than all positive
floating-point constants. <rdar://problem/12029145>
llvm-svn: 161452
|
| |
|
|
|
|
|
|
| |
do so when the high bits are known zero. This caused a subtle miscompilation.
rdar://12027825
llvm-svn: 161451
|
| |
|
|
|
|
|
| |
character arrays. This is in line with what GCC does.
<rdar://problem/10529227>
llvm-svn: 161446
|
| |
|
|
|
|
|
|
|
|
|
|
| |
A target index operand looks a lot like a constant pool reference, but
it is completely target-defined. It contains the 8-bit TargetFlags, a
32-bit index, and a 64-bit offset. It is preserved by all code generator
passes.
TargetIndex operands can be used to carry target-specific information in
cases where immediate operands won't suffice.
llvm-svn: 161441
|
| |
|
|
| |
llvm-svn: 161438
|
| |
|
|
| |
llvm-svn: 161437
|
| |
|
|
|
|
|
|
| |
Compare the critical paths of the two traces through an if-conversion
candidate. If the difference is larger than the branch brediction
penalty, reject the if-conversion. If would never pay.
llvm-svn: 161433
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a use or a BB, but it is inline in the handling of the invoke instruction.
This patch refactors it so that it can be used in other cases. For example, in
define i32 @f(i32 %x) {
bb0:
%cmp = icmp eq i32 %x, 0
br i1 %cmp, label %bb2, label %bb1
bb1:
br label %bb2
bb2:
%cond = phi i32 [ %x, %bb0 ], [ 0, %bb1 ]
%foo = add i32 %cond, %x
ret i32 %foo
}
GVN should be able to replace %x with 0 in any use that is dominated by the
true edge out of bb0. In the above example the only such use is the one in
the phi.
llvm-svn: 161429
|
| |
|
|
|
|
| |
Thanks to Alex Rosenberg for the suggestion.
llvm-svn: 161428
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
and "instruction address -> file/line" lookup.
Instead of plain collection of rows, debug line table for compilation unit is now
treated as the number of row ranges, describing sequences (series of contiguous machine
instructions). The sequences are not always listed in the order of increasing
address, so previously used std::lower_bound() sometimes produced wrong results.
Now the instruction address lookup consists of two stages: finding the correct
sequence, and searching for address in range of rows for this sequence.
llvm-svn: 161414
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We give a bonus for every argument because the argument setup is not needed
anymore when the function is inlined. With this patch we interpret byval
arguments as a compact representation of many arguments. The byval argument
setup is implemented in the backend as an inline memcpy, so to model the
cost as accurately as possible we take the number of pointer-sized elements
in the byval argument and give a bonus of 2 instructions for every one of
those. The bonus is capped at 8 elements, which is the number of stores
at which the x86 backend switches from an expanded inline memcpy to a real
memcpy. It would be better to use the real memcpy threshold from the backend,
but it's not available via TargetData.
This change brings the performance of c-ray in line with gcc 4.7. The included
test case tries to reproduce the c-ray problem to catch regressions for this
benchmark early, its performance is dominated by the inline decision of a
specific call.
This only has a small impact on most code, more on x86 and arm than on x86_64
due to the way the ABI works. When building LLVM for x86 it gives a small
inline cost boost to virtually any function using StringRef or STL allocators,
but only a 0.01% increase in overall binary size. The size of gcc compiled by
clang actually shrunk by a couple bytes with this patch applied, but not
significantly.
llvm-svn: 161413
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
instsimplify+inline strategy.
The crux of the problem is that instsimplify was reasonably relying on
an invariant that is true within any single function, but is no longer
true mid-inline the way we use it. This invariant is that an argument
pointer != a local (alloca) pointer.
The fix is really light weight though, and allows instsimplify to be
resiliant to these situations: when checking the relation ships to
function arguments, ensure that the argumets come from the same
function. If they come from different functions, then none of these
assumptions hold. All credit to Benjamin Kramer for coming up with this
clever solution to the problem.
llvm-svn: 161410
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, MBP essentially aligned every branch target it could. This
bloats code quite a bit, especially non-looping code which has no real
reason to prefer aligned branch targets so heavily.
As Andy said in review, it's still a bit odd to do this without a real
cost model, but this at least has much more plausible heuristics.
Fixes PR13265.
llvm-svn: 161409
|
| |
|
|
|
|
|
|
|
| |
If the result of a common subexpression is used at all uses of the candidate
expression, CSE should not increase the live range of the common subexpression.
rdar://11393714 and rdar://11819721
llvm-svn: 161396
|
| |
|
|
|
|
|
|
| |
--- Reverse-merging r161371 into '.':
U include/llvm/Target/TargetData.h
U lib/Target/TargetData.cpp
llvm-svn: 161394
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
initialize fields of the class that it used.
The result was nonsense code.
Before:
0000000000000000 <foo>:
0: 00441100 0x441100
4: 03e00008 jr ra
8: 00000000 nop
After:
0000000000000000 <foo>:
0: 00041000 sll v0,a0,0x0
4: 03e00008 jr ra
8: 00000000 nop
llvm-svn: 161377
|
| |
|
|
| |
llvm-svn: 161371
|
| |
|
|
|
|
|
|
|
|
|
| |
This allows codegen passes to query properties like
InstrItins->SchedModel->IssueWidth. It also ensure's that
computeOperandLatency returns the X86 defaults for loads and "high
latency ops". This should have no significant impact on existing
schedulers because X86 defaults happen to be the same as global
defaults.
llvm-svn: 161370
|
| |
|
|
|
|
|
|
| |
I hit this in a very large program (spirit.cpp), but
have not figured out how to make a small make check
test for it.
llvm-svn: 161366
|
| |
|
|
|
|
|
|
|
|
| |
were using a class defined for 32 bit instructions and
thus the instruction was for addiu instead of daddiu.
This was corrected by adding the instruction opcode as a
field in the base class to be filled in by the defs.
llvm-svn: 161359
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
These 2 relocations gain access to the
highest and the second highest 16 bits
of a 64 bit object.
R_MIPS_HIGHER %higher(A+S)
The %higher(x) function is [ (((long long) x + 0x80008000LL) >> 32) & 0xffff ].
R_MIPS_HIGHEST %highest(A+S)
The %highest(x) function is [ (((long long) x + 0x800080008000LL) >> 48) & 0xffff ].
llvm-svn: 161348
|
| |
|
|
|
|
|
|
|
|
|
| |
The MFTB instruction itself is being phased out, and its functionality
is provided by MFSPR. According to the ISA docs, using MFSPR works on all known
chips except for the 601 (which did not have a timebase register anyway)
and the POWER3.
Thanks to Adhemerval Zanella for pointing this out!
llvm-svn: 161346
|
| |
|
|
|
|
| |
Patch by David Hill.
llvm-svn: 161344
|
| |
|
|
| |
llvm-svn: 161328
|
| |
|
|
|
|
| |
custom handling in DAGISelToDAG due to limitations in TableGen's implicit def handling. Fixes PR11305.
llvm-svn: 161318
|
| |
|
|
|
|
| |
represented in a pattern.
llvm-svn: 161306
|
| |
|
|
|
|
| |
for pcmpestrm/pcmpistrm. Allows the register allocator to handle it better and prevent wasted identity moves.
llvm-svn: 161305
|
| |
|
|
|
|
|
|
| |
On PPC64, this can be done with a simple TableGen pattern.
To enable this, I've added the (otherwise missing) readcyclecounter
SDNode definition to TargetSelectionDAG.td.
llvm-svn: 161302
|
| |
|
|
| |
llvm-svn: 161301
|
| |
|
|
|
|
|
|
|
| |
stuff
(this corresponds by spilling/reloading regs in DTriple / DQuad reg classes).
No testcase, found by inspection.
llvm-svn: 161300
|
| |
|
|
|
|
|
|
| |
classes, which
were missed for no reason. This fixes PR13377
llvm-svn: 161299
|
| |
|
|
|
|
|
|
| |
a slice of the old name.
Fixes PR13522. Add a rudimentary unit test to exercise the behavior.
llvm-svn: 161296
|
| |
|
|
|
|
| |
TwoAddressInstructionPass doesn't remat any more.
llvm-svn: 161285
|
| |
|
|
| |
llvm-svn: 161284
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
No functional change intended, except replacing a DenseMap with a
SmallDenseMap which should behave identically.
llvm-svn: 161281
|
| |
|
|
|
|
|
| |
This is far from complete, and only changes behavior when the
-early-live-intervals flag is passed to llc.
llvm-svn: 161273
|
| |
|
|
|
|
|
|
|
| |
Change these to patterns.
2. Add another 16 instructions.
Patch by Reed Kotler.
llvm-svn: 161272
|
| |
|
|
|
|
|
|
|
|
| |
This option runs LiveIntervals before TwoAddressInstructionPass which
will eventually learn to exploit and update the analysis.
Eventually, LiveIntervals will run before PHIElimination, and we can get
rid of LiveVariables.
llvm-svn: 161270
|
| |
|
|
|
|
|
| |
Previously, the identity copy would survive through register allocation
before it was removed by the rewriter.
llvm-svn: 161269
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
The 'unused' state of a value number can be represented as an invalid
def SlotIndex. This also exposed code that shouldn't have been looking
at unused value VNInfos.
llvm-svn: 161258
|
| |
|
|
|
|
|
| |
Unused VNInfos should be left alone. Their def SlotIndex doesn't point
to anything.
llvm-svn: 161257
|
| |
|
|
| |
llvm-svn: 161256
|
| |
|
|
|
|
|
|
|
|
| |
The only real user of the flag was removeCopyByCommutingDef(), and it
has been switched to LiveIntervals::hasPHIKill().
All the code changed by this patch was only concerned with computing and
propagating the flag.
llvm-svn: 161255
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The VNInfo::HAS_PHI_KILL is only half supported. We precompute it in
LiveIntervalAnalysis, but it isn't properly updated by live range
splitting and functions like shrinkToUses().
It is only used in one place: RegisterCoalescer::removeCopyByCommutingDef().
This patch changes that function to use a new LiveIntervals::hasPHIKill()
function that computes the flag for a given value number.
llvm-svn: 161254
|
| |
|
|
| |
llvm-svn: 161242
|