Commit Graph

71326 Commits

Author SHA1 Message Date
Eric Christopher 64749f2a89 Lex, and then fail on invalid constants.
Testcase forthcoming.

rdar://8490596

llvm-svn: 129309
2011-04-11 22:24:56 +00:00
Nick Lewycky 0f85789800 Just because a GlobalVariable's initializer is [N x { i32, void ()* }] doesn't
mean that it has to be ConstantArray of ConstantStruct. We might have
ConstantAggregateZero, at either level, so don't crash on that.

Also, semi-deprecate the sentinal value. The linker isn't aware of sentinals so
we end up with the two lists appended, each with their "sentinals" on them.
Different parts of LLVM treated sentinals differently, so make them all just
ignore the single entry and continue on with the rest of the list.

llvm-svn: 129307
2011-04-11 22:11:20 +00:00
Rafael Espindola 82065cb6cf Implement cfi_rel_offset
llvm-svn: 129306
2011-04-11 21:49:50 +00:00
Jakob Stoklund Olesen 0f175ebc32 Speed up eviction by stopping collectInterferingVRegs as soon as the spill
weight limit has been exceeded.

llvm-svn: 129305
2011-04-11 21:47:01 +00:00
Rafael Espindola 4f46abc15e Add test for previous commit.
llvm-svn: 129304
2011-04-11 21:41:34 +00:00
Wesley Peck e3685217d0 Don't crash on invalid instructions when disassembling MBlaze code.
This fixes http://llvm.org/bugs/show_bug.cgi?id=9653

llvm-svn: 129303
2011-04-11 21:35:21 +00:00
Bill Wendling 1e1f1c9ce1 The default of the dispatch switch statement was to branch to a BB that executed
the 'unwind' instruction. However, later on that instruction was converted into
a jump to the basic block it was located in, causing an infinite loop when we
get there.

It turns out, we get there if the _Unwind_Resume_or_Rethrow call returns (which
it's not supposed to do). It returns if it cannot find a place to unwind
to. Thus we would get what appears to be a "hang" when in reality it's just that
the EH couldn't be propagated further along.

Instead of infinitely looping (or calling `unwind', which none of our back-ends
support (it's lowered into nothing...)), call the @llvm.trap() intrinsic
instead. This may not conform to specific rules of a particular language, but
it's rather better than infinitely looping.

<rdar://problem/9175843&9233582>

llvm-svn: 129302
2011-04-11 21:32:34 +00:00
Johnny Chen f79d5365de Fix the bug where the immediate shift amount for Thumb logical shift instructions are incorrectly disassembled.
rdar://problem/9266265

llvm-svn: 129298
2011-04-11 21:14:35 +00:00
Evan Cheng ef42bea704 Look pass copies when determining whether hoisting would end up inserting more copies. rdar://9266679
llvm-svn: 129297
2011-04-11 21:09:18 +00:00
Rafael Espindola ffd2e5163b implement .cfi_adjust_cfa_offset.
llvm-svn: 129296
2011-04-11 20:29:16 +00:00
Eli Friedman 2c81975bae Get rid of useless comment; if a file uses functions from a given header,
it is obvious that it should be included.

llvm-svn: 129295
2011-04-11 20:16:05 +00:00
Owen Anderson 5140802cd9 Fix another using-CPSR-twice bug in my ADCS/SBCS cleanups, and make proper use of the Commutable bit.
llvm-svn: 129294
2011-04-11 20:12:19 +00:00
Jakob Stoklund Olesen b16e948029 Skip a binary search when possible.
llvm-svn: 129293
2011-04-11 20:01:44 +00:00
Jakob Stoklund Olesen 7d05bce70c Use a faster algorithm for computing MBB live-in registers after register allocation.
LiveIntervals::findLiveInMBBs has to do a full binary search for each segment.

llvm-svn: 129292
2011-04-11 20:01:41 +00:00
Garrison Venn 56c5ca2ee1 Because some systems have reported that this example would not build the
header file cstdio was added as an include.

llvm-svn: 129291
2011-04-11 19:52:49 +00:00
Johnny Chen 74adbddade Trivial comment fix.
llvm-svn: 129288
2011-04-11 18:51:50 +00:00
Evan Cheng fe917efc8b Fix a couple of places where changes are made but not tracked.
llvm-svn: 129287
2011-04-11 18:47:20 +00:00
Johnny Chen 66fab75920 Check invalid register encodings for LdFrm/StFrm ARM instructions and flag them as
invalid instructions.

llvm-svn: 129286
2011-04-11 18:34:12 +00:00
Kevin Enderby 9377a52c12 Adding support for printing operands symbolically to llvm's public 'C'
disassembler API.  Hooked this up to the ARM target so such tools as Darwin's
otool(1) can now print things like branch targets for example this:
  blx _puts
instead of this:
  blx #-36
And even print the expression encoded in the Mach-O relocation entried for
things like this:
  movt r0, :upper16:((_foo-_bar)+1234)

llvm-svn: 129284
2011-04-11 18:08:50 +00:00
Jakob Stoklund Olesen f8beafe207 Don't add live ranges for sub-registers when clobbering a physical register.
Both coalescing and register allocation already check aliases for interference,
so these extra segments are only slowing us down.

This speeds up both linear scan and the greedy register allocator.

llvm-svn: 129283
2011-04-11 18:08:10 +00:00
Jakob Stoklund Olesen 4fbbe3689d Speed up LiveIntervalUnion::unify by handling end insertion specially.
This particularly helps with the initial transfer of fixed intervals.

llvm-svn: 129277
2011-04-11 15:00:44 +00:00
Jakob Stoklund Olesen bfabc494f5 Time the initial seeding of live registers
llvm-svn: 129276
2011-04-11 15:00:42 +00:00
Jakob Stoklund Olesen 96d04c8e00 Don't shrink live ranges after dead code elimination unless it is going to help.
In particular, don't repeatedly recompute the PIC base live range after rematerialization.

llvm-svn: 129275
2011-04-11 15:00:39 +00:00
Oscar Fuentes c6f2d0a4cf CMake: remove some unnecesary code and ToDos.
Patch by arrowdodger!

llvm-svn: 129274
2011-04-11 14:52:39 +00:00
Jay Foad 0159a1ee11 Fix or remove code which seemed to think that the operand of a Constant
was always a User.

llvm-svn: 129272
2011-04-11 09:48:55 +00:00
Jay Foad 7c14a558fe Don't include Operator.h from InstrTypes.h.
llvm-svn: 129271
2011-04-11 09:35:34 +00:00
Jay Foad 29426e87c1 Phi nodes always use an even number of operands, so don't ever allocate
an odd number.

llvm-svn: 129270
2011-04-11 09:25:51 +00:00
NAKAMURA Takumi 62920834fa docs/CommandGuide/index.html: Fix CSS url to relative.
llvm-svn: 129268
2011-04-11 03:27:38 +00:00
NAKAMURA Takumi 2a7024fa6c docs/CommandLine.html: &quot;ize.
llvm-svn: 129267
2011-04-11 03:27:31 +00:00
Bill Wendling 35a9c3cd72 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

llvm-svn: 129259
2011-04-10 23:18:04 +00:00
Nicolas Geoffray 9137ee85de Bugfix in the Cpp backend after API change on PHINode::Create.
llvm-svn: 129248
2011-04-10 17:39:40 +00:00
Oscar Fuentes dbe99ba37d CMake: support for using LLVM from client projects with find_package.
Patch by arrowdodger!

llvm-svn: 129247
2011-04-10 16:17:49 +00:00
Garrison Venn 88bd9d6bb8 Fixed more best practices, and explicit/implicit style guide issues.
llvm-svn: 129245
2011-04-10 14:06:52 +00:00
Oscar Fuentes fe40844fb6 Reword instructions for running tests on Visual Studio.
Suggested by Maël Hörz.

llvm-svn: 129237
2011-04-10 01:41:55 +00:00
Bill Wendling 3d5450d809 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.)

llvm-svn: 129235
2011-04-10 00:04:27 +00:00
Chris Lattner b799b2d4be drive by bug fix: DenseMapInfo::isEqual should be determined according to
isEqual of its members, not operator==.

llvm-svn: 129233
2011-04-09 21:20:23 +00:00
Chris Lattner 077f0179bb LLVMCC_EMITIR_FLAG is already either -emit-llvm or -fplugin-arg-dragonegg-emit-ir, so don't add an extra leading -. Clang doesn't accept --emit-llvm.
llvm-svn: 129232
2011-04-09 19:56:28 +00:00
Chris Lattner 96d2507e79 make stuff work when LLVMCC_OPTION is something like installed-clang, not just clang.
llvm-svn: 129229
2011-04-09 19:53:16 +00:00
Chris Lattner fc4fe00a65 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.

llvm-svn: 129223
2011-04-09 19:41:05 +00:00
Chris Lattner 214f114aa7 look for the verboten argument slot access in any order, thanks to Frits
for pointing this out

llvm-svn: 129217
2011-04-09 17:00:34 +00:00
Benjamin Kramer 26e7768f38 Fix potential buffer overflow on win32.
llvm-svn: 129214
2011-04-09 14:06:12 +00:00
Benjamin Kramer 2b6c96b43d Don't store Twine temporaries, it's not safe.
And don't append the name over and over again in the loop.

llvm-svn: 129210
2011-04-09 11:26:27 +00:00
Benjamin Kramer 2792f2b86b Make error message more useful.
llvm-svn: 129209
2011-04-09 10:10:35 +00:00
NAKAMURA Takumi 6bd36d56e4 docs/*.html: Make W3C HTML 4.01 Strict more compliant.
FIXME: The logo handling in ReleaseNotes.html
llvm-svn: 129208
2011-04-09 09:51:57 +00:00
Eli Friedman 9cca0715aa 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.

llvm-svn: 129207
2011-04-09 09:11:09 +00:00
Chris Lattner 88974f4625 fix PR9523, a crash in looprotate on a non-canonical loop made out of indirectbr.
llvm-svn: 129203
2011-04-09 07:25:58 +00:00
Chris Lattner af1bccec68 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.

llvm-svn: 129200
2011-04-09 07:05:44 +00:00
Chris Lattner cfe5aa65d2 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.

llvm-svn: 129199
2011-04-09 06:57:13 +00:00
Eli Friedman 17822fcde9 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.

llvm-svn: 129198
2011-04-09 06:55:46 +00:00
Eli Friedman 4db39cefdb Test for r129190.
llvm-svn: 129197
2011-04-09 06:39:43 +00:00