Commit Graph

55227 Commits

Author SHA1 Message Date
Eric Christopher
caba263c8e Reduce some code duplication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159701 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-04 02:02:18 +00:00
Matt Beaumont-Gay
00f43076a3 Fix some ascii art in a comment to not have trailing backslashes (inspiration
from IfConversion.cc), and fix some spelling and grammar in the surrounding
prose.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159699 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-04 01:09:45 +00:00
Jakob Stoklund Olesen
59bde4d8a1 Add early if-conversion support to X86.
Implement the TII hooks needed by EarlyIfConversion to create cmov
instructions and estimate their latency.

Early if-conversion is still not enabled by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159695 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-04 00:09:58 +00:00
Jakob Stoklund Olesen
33242fd3ed Add an experimental early if-conversion pass, off by default.
This pass performs if-conversion on SSA form machine code by
speculatively executing both sides of the branch and using a cmov
instruction to select the result. This can help lower the number of
branch mispredictions on architectures like x86 that don't have
predicable instructions.

The current implementation is very aggressive, and causes regressions on
mosts tests. It needs good heuristics that have yet to be implemented.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159694 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-04 00:09:54 +00:00
Nuno Lopes
0fd518beb3 PHINode::hasConstantValue(): return undef if the PHI is fully recursive.
Thanks Duncan for the idea

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159687 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-03 21:15:40 +00:00
Bill Wendling
86b032b2ab Use the DebugInfo's 'print()' method to emit the comments.
These give quite a bit more information about the DebugInfo and makes it more
readable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159680 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-03 20:01:02 +00:00
Nuno Lopes
42d80c7a5b BoundsChecking: optimize out the check for offset < 0 if size is known to be >= 0 (signed).
(LLVM optimizers cannot do this optimization by themselves)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159668 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-03 17:30:18 +00:00
Nuno Lopes
0dff532fce fold PHI nodes in SizeOffsetEvaluator whenever possible.
Unfortunately this change requires the cache map to hold WeakVHs instead

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159667 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-03 17:13:25 +00:00
Nuno Lopes
44d5c06488 improve PHINode::hasConstantValue() to detect recursive cases like %phi = phi(%phi,42) as constant
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159666 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-03 17:10:28 +00:00
Stepan Dyatkovskiy
6a59073735 Part of r159527. Splitted into series of patches and gone with fixed PR13256:
IntegersSubsetMapping
  - Replaced type of Items field from std::list with std::map. In neares future I'll test it with DenseMap and do the correspond replacement
    if possible.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159659 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-03 13:46:45 +00:00
Craig Topper
1e59c78ab7 Remove extra space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159647 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-03 06:48:58 +00:00
Craig Topper
f2c1cf2f98 Change i128mem/i256mem to f128mem/f256mem on some floating point vector instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159646 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-03 06:11:06 +00:00
NAKAMURA Takumi
a6f14537ca MCContext.cpp: Fixup for my odd previous commit. No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159645 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-03 06:01:27 +00:00
Craig Topper
a101014026 Add aliases for pblendvb, blendvpd, and blendvps instructions with the implicit xmm0 operand specified. Fixes PR13252.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159644 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-03 05:49:45 +00:00
NAKAMURA Takumi
4c215c08e3 MCContext::GetDwarfFile(): Make FileName parsing tolerant of DOSish pathsep with PathV2.
It fixes failure in test/MC/MachO/gen-dwarf.s on Win32 w/o bash.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159640 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-03 03:59:29 +00:00
Jack Carter
10de025a67 mips32 long long register inline asm constraint support.
inlineasm-cnstrnt-bad-r-1.ll is NOT supposed to fail, so it was removed.    This resulted in the removal of a negative test (inlineasm-cnstrnt-bad-r-1.ll)
    


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159625 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 23:35:23 +00:00
Eric Christopher
80c1b38eff Revert " mips32 long long register inline asm constraint support." as
it appears to be breaking the bots.

This reverts commit 1b055ce320.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159619 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 23:22:25 +00:00
Eric Christopher
c723eb1aef Revert "IntRange:" as it appears to be breaking self hosting.
This reverts commit b2833d9dcb.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159618 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 23:22:21 +00:00
Chandler Carruth
6068c48498 All glory to address sanitizer. ;]
It appears to have caught a use-after-free introduced as by r159567
and/or friends which call 'addPass' from many more places. The bug in
'addPass' doesn't appear to be new, and was spotted by inspection when
ASan shown a bright light of a stacktrace at these functions.

Hopefully this will fix the ASan failure -- I have no test case other
than running an ASan-built clang over the test suite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159614 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 22:56:41 +00:00
Evan Cheng
769951f6cc Target option DisableJumpTables is a gross hack. Move it to TargetLowering instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159611 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 22:39:56 +00:00
Jack Carter
1b055ce320 mips32 long long register inline asm constraint support.
inlineasm-cnstrnt-bad-r-1.ll is NOT supposed to fail, so it was removed.    This resulted in the removal of a negative test (inlineasm-cnstrnt-bad-r-1.ll)
    


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159610 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 22:39:45 +00:00
Andrew Trick
3d4ed08574 misched: allow NULL InstrItineraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159599 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 21:55:12 +00:00
Eric Christopher
9eb4f8a3e6 Turn an assert into an error to make it a bit more friendly.
Part of rdar://6880388 and rdar://11766377

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159590 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 21:16:43 +00:00
Jack Carter
39ae36337f Pass the correct ELFOSABI enumeration to the MipsELFObjectWriter constructor
Contributer: Sasa Stankovic 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159574 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 20:04:43 +00:00
Bob Wilson
30a507a1f5 Extend TargetPassConfig to allow running only a subset of the normal passes.
This is still a work in progress but I believe it is currently good enough
to fix PR13122 "Need unit test driver for codegen IR passes".  For example,
you can run llc with -stop-after=loop-reduce to have it dump out the IR after
running LSR.  Serializing machine-level IR is not yet supported but we have
some patches in progress for that.

The plan is to serialize the IR to a YAML file, containing separate sections
for the LLVM IR, machine-level IR, and whatever other info is needed.  Chad
suggested that we stash the stop-after pass in the YAML file and use that
instead of the start-after option to figure out where to restart the
compilation.  I think that's a great idea, but since it's not implemented yet
I put the -start-after option into this patch for testing purposes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159570 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 19:48:45 +00:00
Bob Wilson
6b2bb15bf7 Move assertion with TargetPassConfig's Initialized flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159569 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 19:48:39 +00:00
Bob Wilson
3fb99a7368 Consistently use AnalysisID types in TargetPassConfig.
This makes it possible to just use a zero value to represent "no pass", so
the phony NoPassID global variable is no longer needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159568 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 19:48:37 +00:00
Bob Wilson
564fbf6aff Add all codegen passes to the PassManager via TargetPassConfig.
This is a preliminary step toward having TargetPassConfig be able to
start and stop the compilation at specified passes for unit testing
and debugging.  No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159567 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 19:48:31 +00:00
Andrew Trick
14ccc7b963 Revert accidental checkin.
My last checkin was apparently not the branch I intended. It was missing one change (added by chandlerc), and contained a spurious change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159548 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 19:12:29 +00:00
Duncan Sands
b2fe7f183d GlobalOpt forgot to handle bitcast when analyzing globals. Found by inspection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159546 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 18:55:39 +00:00
Manman Ren
5f917cd3fa Added assertion in getVRegDef of MachineRegisterInfo to make sure the virtual
register does not have multiple definitions. Modified TwoAddressInstructionPass
to use getUniqueVRegDef instead of getVRegDef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159545 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 18:55:36 +00:00
Andrew Trick
218ee74a01 Reapply "Make NumMicroOps a variable in the subtarget's instruction itinerary."
Reapplies r159406 with minor cleanup. The regressions appear to have been spurious.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159541 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 18:10:42 +00:00
Bob Wilson
ac03af4ea9 Do not attempt to use ROR for Thumb1.
Patch by Matt Fischer!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159538 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 17:22:47 +00:00
Nuno Lopes
4ccb89c71f fix the regression I introduced in r159385 (it's necessary to update PHI nodes in unwind BB
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159534 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 16:14:47 +00:00
Stepan Dyatkovskiy
b2833d9dcb IntRange:
- Changed isSingleNumber method behaviour. Now this flag is calculated on demand.
IntegersSubsetMapping
  - Optimized diff operation.
  - Replaced type of Items field from std::list with std::map.
  - Added new methods:
    bool isOverlapped(self &RHS)
    void add(self& RHS, SuccessorClass *S)
    void detachCase(self& NewMapping, SuccessorClass *Succ)
    void removeCase(SuccessorClass *Succ)
    SuccessorClass *findSuccessor(const IntTy& Val)
    const IntTy* getCaseSingleNumber(SuccessorClass *Succ)
IntegersSubsetTest
  - DiffTest: Added checks for successors.
SimplifyCFG
  Updated SwitchInst usage (now it is case-ragnes compatible) for
    - SimplifyEqualityComparisonWithOnlyPredecessor
    - FoldValueComparisonIntoPredecessors



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159527 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 13:02:18 +00:00
Kostya Serebryany
56139bc493 [asan] small code simplification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159522 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 11:42:29 +00:00
Alexey Samsonov
3e25c4a1e3 This patch extends the libLLVMDebugInfo which contains a minimalistic DWARF parser:
1) DIContext is now able to return function name for a given instruction address (besides file/line info).
2) llvm-dwarfdump accepts flag --functions that prints the function name (if address is specified by --address flag).
3) test case that checks the basic functionality of llvm-dwarfdump added

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159512 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 05:54:45 +00:00
Rafael Espindola
9c3d5a70f4 Now that RegistersDefinedFromSameValue handles one instruction being an
implicit_def, the other instruction can be anything, including instructions
that define multiple values. Be careful about that and don't assume what operand
0 is.
Fixes pr13249.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159509 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-01 17:08:01 +00:00
Elena Demikhovsky
8f40f7b867 Optimization of shuffle node that can fit to the register form of VBROADCAST instruction on AVX2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159504 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-01 06:12:26 +00:00
Craig Topper
51e89c0d6a Reduce code size by using a second switch statement to avoid extra calls to SelectAtomic64. Also catch cases where SelectAtomic64 fails.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159503 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-01 02:55:34 +00:00
Craig Topper
65b382cf91 Add a break to the end of case statement missed in r159501.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159502 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-01 02:18:18 +00:00
Craig Topper
15d39adbca Fix a crash on release builds if gather intrinsics are passed a non-constant value for the last argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159501 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-01 02:17:08 +00:00
Craig Topper
de6e484c15 Use a second switch statement to reduce number of calls to SelectGather in code. Reduces code size a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159500 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-01 02:05:52 +00:00
Benjamin Kramer
992c25a3fc Reduce use list thrashing by using DenseMap's find_as for maps with ValueHandle keys.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159497 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-30 22:37:15 +00:00
Bill Wendling
c1b6ea7b6c Don't reinsert the 'atexit' function if it already exists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159491 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-30 20:21:19 +00:00
Rafael Espindola
682e8d05c7 Handle implicit_defs in the register coalescer. I am still trying to produce
a reduced testcase, but this fixes pr13209.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159479 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-30 01:45:55 +00:00
Nuno Lopes
ea47553006 revert r159440. As Duncan pointed out, the test for invoke is not needed at this point
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159471 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-29 22:10:10 +00:00
Manman Ren
76c6ccbd4c ARM: Clean up optimizeCompare in peephole, no functional change.
Use getUniqueVRegDef.
Replace a loop with existing interfaces: modifiesRegister and readsRegister.
Factor out code into inline functions and simplify the code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159470 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-29 22:06:19 +00:00
Manman Ren
de7266c611 Add SrcReg2 to analyzeCompare and optimizeCompareInstr to handle Compare
instructions with two register operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159465 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-29 21:33:59 +00:00
Jakob Stoklund Olesen
8ccaad526a Clear kill flags in InstrEmitter::EmitSubregNode().
When a local virtual register is made global, make sure to clear any
existing kill flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159461 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-29 21:00:03 +00:00