Commit Graph

46455 Commits

Author SHA1 Message Date
Jay Foad
8340d0b659 Fix or remove code which seemed to think that the operand of a Constant
was always a User.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129272 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-11 09:48:55 +00:00
Jay Foad
562b84b3ae Don't include Operator.h from InstrTypes.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129271 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-11 09:35:34 +00:00
Jay Foad
4e9b0e3587 Phi nodes always use an even number of operands, so don't ever allocate
an odd number.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129270 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-11 09:25:51 +00:00
Bill Wendling
5d7a5a4f53 Revert r129235 pending a vetting of the EH rewrite.
--- Reverse-merging r129235 into '.':
D    test/Feature/bb_attrs.ll
U    include/llvm/BasicBlock.h
U    include/llvm/Bitcode/LLVMBitCodes.h
U    lib/VMCore/AsmWriter.cpp
U    lib/VMCore/BasicBlock.cpp
U    lib/AsmParser/LLParser.cpp
U    lib/AsmParser/LLLexer.cpp
U    lib/AsmParser/LLToken.h
U    lib/Bitcode/Reader/BitcodeReader.cpp
U    lib/Bitcode/Writer/BitcodeWriter.cpp



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129259 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-10 23:18:04 +00:00
Nicolas Geoffray
c6cf197315 Bugfix in the Cpp backend after API change on PHINode::Create.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129248 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-10 17:39:40 +00:00
Bill Wendling
d7bb295d22 Beginning of the Great Exception Handling Rewrite.
* Add a "landing pad" attribute to the BasicBlock.
* Modify the bitcode reader and writer to handle said attribute.

Later: The verifier will ensure that the landing pad attribute is used in the
appropriate manner. I.e., not applied to the entry block, and applied only to
basic blocks that are branched to via a `dispatch' instruction.

(This is a work-in-progress.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129235 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-10 00:04:27 +00:00
Chris Lattner
15f8951799 fix rdar://8735979 - "int 3" doesn't match to "int3". Unfortunately,
InstAlias doesn't allow matching immediate operands, so we have to write
C++ code to do this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129223 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 19:41:05 +00:00
Benjamin Kramer
5731ff636b Fix potential buffer overflow on win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129214 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 14:06:12 +00:00
Benjamin Kramer
c18214a6e0 Don't store Twine temporaries, it's not safe.
And don't append the name over and over again in the loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129210 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 11:26:27 +00:00
Benjamin Kramer
cc513e1cf1 Make error message more useful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129209 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 10:10:35 +00:00
Eli Friedman
18a2e50a9b Add back a couple checks removed by r129128; the fact that an intitializer
is an array of structures doesn't imply it's a ConstantArray of
ConstantStruct.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129207 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 09:11:09 +00:00
Chris Lattner
f5bf464b70 fix PR9523, a crash in looprotate on a non-canonical loop made out of indirectbr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129203 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 07:25:58 +00:00
Chris Lattner
0403b473dd Fix a bug where RecursivelyDeleteTriviallyDeadInstructions could
delete the instruction pointed to by CGP's current instruction
iterator, leading to a crash on the testcase.  This fixes PR9578.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129200 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 07:05:44 +00:00
Chris Lattner
c3e4e59d10 Avoid excess precision issues that lead to generating host-compiler-specific code.
Switch lowering probably shouldn't be using FP for this.  This resolves PR9581.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129199 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 06:57:13 +00:00
Eli Friedman
9055ccdb6b PR9604; try to deal with RAUW updates correctly in the AST. I'm not convinced
it's completely safe to cache the AST across LICM runs even with this fix,
but this fix can't hurt.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129198 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 06:55:46 +00:00
Chris Lattner
6ff80b2281 regexes are allowed to match empty things, e.g. {{.*}} in filecheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129193 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 06:29:24 +00:00
Jakob Stoklund Olesen
f4afdfc501 Build the Hopfield network incrementally when splitting global live ranges.
It is common for large live ranges to have few basic blocks with register uses
and many live-through blocks without any uses. This approach grows the Hopfield
network incrementally around the use blocks, completely avoiding checking
interference for some through blocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129188 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 02:59:09 +00:00
Jakob Stoklund Olesen
9d29cbad32 Precompute interference for neighbor blocks as long as there is no interference.
This doesn't require seeking in the live interval union, so it is very cheap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129187 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 02:59:05 +00:00
Chris Lattner
b3452ea35c have dag combine zap "store undef", which can be formed during call lowering
with undef arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129185 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 02:32:02 +00:00
Sean Callanan
457856c03f Redirected errors from the AsmParser to the proper
error stream, in cases where the AsmParser is
being invoked by EDDisassembler.  Before, they
were being sent to errs() because no error handler
was installed in the SourceMgr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129177 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 00:37:25 +00:00
Devang Patel
3f932a74be Simplify array bound checks and clarify comments. One element array can have same non-zero number as lower bound as well as upper bound.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129170 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-08 23:39:38 +00:00
Nick Lewycky
918035f802 Add a function for profiling to run at shutdown. Unlike the existing API, this
can be used even when main() isn't present in the Module, but it means that you
don't get to read argv[].


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129163 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-08 22:19:52 +00:00
Matt Beaumont-Gay
7c90e46622 Fix an apparent typo that made GCC complain
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129160 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-08 21:59:49 +00:00
Devang Patel
fb6e8d6554 Do not emit DW_AT_upper_bound and DW_AT_lower_bound for unbouded array.
If lower bound is more then upper bound then consider it is an unbounded array.
An array is unbounded if non-zero lower bound is same as upper bound.
If lower bound and upper bound are zero than array has one element.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129156 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-08 21:55:10 +00:00
Evan Cheng
4da0c7c0c9 Change -arm-trap-func= into a non-arm specific option. Now Intrinsic::trap is lowered into a call to the specified trap function at sdisel time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129152 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-08 21:37:21 +00:00
Jim Grosbach
e2e777b0e7 Workaround g++ 4.2.1 warning diagnostic false positive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129149 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-08 21:11:20 +00:00
Johnny Chen
ee10b13a44 Check opcoe (dmb, dsb) instead of bitfields matching.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129148 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-08 20:03:46 +00:00
Johnny Chen
c636074afc Hanlde the checking of bad regs for SMMLAR properly, instead of asserting.
PR9650
rdar://problem/9257565


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129147 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-08 19:41:22 +00:00
Johnny Chen
40de2b3f15 Sanity check the option operand for DMB/DSB.
PR9648
rdar://problem/9257634


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129146 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-08 19:18:07 +00:00
Jim Grosbach
5b03a3a59a Mark hasExtraDefRegAllocReq=1 on LDRD.
The previous cleanup of LDRD got overzealous and removed it, causing post-RA
scheduling to get overzealous in breaking antidependencies and invalidate these instructions. Hilarity and invalid assembly ensued.

rdar://9244161


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129144 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-08 18:47:05 +00:00
Jim Grosbach
b027105fa5 Refactor MCJIT 32-bit section loading.
Teach 32-bit section loading to use the Memory Manager interface, just like
the 64-bit loading does. Tidy up a few other things here and there.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129138 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-08 17:31:24 +00:00
Nick Lewycky
2c44a80d99 llvm.global_[cd]tor is defined to be either external, or appending with an array
of { i32, void ()* }. Teach the verifier to verify that, deleting copies of
checks strewn about.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129128 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-08 07:30:21 +00:00
Johnny Chen
97fdff1d3f Add sanity checking for bad register specifier(s) for the DPFrm instructions.
Add more test cases to exercise the logical branches related to the above change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129117 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-08 00:29:09 +00:00
Rafael Espindola
d5321da8d2 Micro optimization and improved similarity with gas' output:
When two section names share a suffix, reuse the entry in shstrtab.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129115 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07 23:21:52 +00:00
Devang Patel
60d490cdc7 Do not let debug info interfer with branch folding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129114 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07 23:11:25 +00:00
Bill Wendling
44dcfd3625 Replace the old algorithm that emitted the "print the alias for an instruction"
with the newer, cleaner model. It uses the IAPrinter class to hold the
information that is needed to match an instruction with its alias. This also
takes into account the available features of the platform.

There is one bit of ugliness. The way the logic determines if a pattern is
unique is O(N**2), which is gross. But in reality, the number of items it's
checking against isn't large. So while it's N**2, it shouldn't be a massive time
sink.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129110 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07 21:20:06 +00:00
Evan Cheng
274d8d4eba Add option to emit @llvm.trap as a function call instead of a trap instruction. rdar://9249183.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129107 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07 20:31:12 +00:00
Rafael Espindola
ce8463f1fb Add support for .skip.
Patch by Roman Divacky.
Fixes PR9361.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129106 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07 20:26:23 +00:00
Akira Hatanaka
8d580659f9 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129105 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07 20:25:10 +00:00
Akira Hatanaka
3f92b439d9 Update ATUsed every time after expandRegLargeImmPair is called.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129104 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07 20:23:26 +00:00
Mon P Wang
e32cdef38e Fixed encoding for VEXTqf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129101 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07 19:56:12 +00:00
Andrew Trick
5469976506 Added a check in the preRA scheduler for potential interference on a
induction variable. The preRA scheduler is unaware of induction vars,
so we look for potential "virtual register cycles" instead.

Fixes <rdar://problem/8946719> Bad scheduling prevents coalescing


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129100 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07 19:54:57 +00:00
Akira Hatanaka
9777e7afd4 Fix handling of functions with internal linkage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129099 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07 19:51:44 +00:00
Johnny Chen
22dc4d9f59 Add sanity checking for invalid register encodings for signed/unsigned extend instructions.
Add some test cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129098 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07 19:28:58 +00:00
Johnny Chen
8dbda0b51b Add sanity checking for invalid register encodings for saturating instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129096 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07 19:02:08 +00:00
Jakob Stoklund Olesen
e815dab69f Recompute hasPHIKill flags when shrinking live intervals.
PHI values may be deleted, causing the flags to be wrong. This fixes PR9616.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129092 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07 18:43:14 +00:00
Johnny Chen
4d4e25740b Add some more comments about checkings of invalid register numbers.
And two test cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129090 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07 18:33:19 +00:00
Rafael Espindola
45e1a53efd Expose more passes to the C API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129087 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07 18:20:46 +00:00
Jakob Stoklund Olesen
f34ae32a6b Avoid moving iterators when the previous block was just visited.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129081 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07 17:27:50 +00:00
Jakob Stoklund Olesen
0bd2bd9ecc Prefer multiplications to divisions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129080 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07 17:27:48 +00:00