1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

35736 Commits

Author SHA1 Message Date
Chris Lattner
333bf5abf5 cleanups.
llvm-svn: 94995
2010-02-01 19:54:45 +00:00
Chris Lattner
8e4042108e fix PR6197 - infinite recursion in ipsccp due to block addresses
evaluateICmpRelation wasn't handling blockaddress.

llvm-svn: 94993
2010-02-01 19:35:08 +00:00
Mon P Wang
f9fa3aa2c0 Fixed a couple of optimization with EXTRACT_VECTOR_ELT that assumes the result
type is the same as the element type of the vector.  EXTRACT_VECTOR_ELT can
be used to extended the width of an integer type.  This fixes a bug for
Generic/vector-casts.ll on a ppc750.

llvm-svn: 94990
2010-02-01 19:03:18 +00:00
Dan Gohman
0b2c2769ba Generalize target-independent folding rules for sizeof to handle more
cases, and implement target-independent folding rules for alignof and
offsetof. Also, reassociate reassociative operators when it leads to
more folding.

Generalize ScalarEvolution's isOffsetOf to recognize offsetof on
arrays. Rename getAllocSizeExpr to getSizeOfExpr, and getFieldOffsetExpr
to getOffsetOfExpr, for consistency with analagous ConstantExpr routines.

Make the target-dependent folder promote GEP array indices to
pointer-sized integers, to make implicit casting explicit and exposed
to subsequent folding.

And add a bunch of testcases for this new functionality, and a bunch
of related existing functionality.

llvm-svn: 94987
2010-02-01 18:27:38 +00:00
Chris Lattner
5f10919836 fix rdar://7590304, a miscompilation of objc apps on arm. The caller
of objc message send was getting marked arm_apcscc, but the prototype
isn't.  This is fine at runtime because objcmsgsend is implemented in
assembly.  Only turn a mismatched caller and callee into 'unreachable'
if the callee is a definition.

llvm-svn: 94986
2010-02-01 18:11:34 +00:00
Chris Lattner
a336497d3f fix rdar://7590304, an infinite loop in instcombine. In the invoke
case, instcombine can't zap the invoke for fear of changing the CFG.
However, we have to do something to prevent the next iteration of
instcombine from inserting another store -> undef before the invoke
thereby getting into infinite iteration between dead store elim and
store insertion.

Just zap the callee to null, which will prevent the next iteration
from doing anything.

llvm-svn: 94985
2010-02-01 18:04:58 +00:00
Bob Wilson
8207d33d94 Fix pr6198 by moving the isSized() check to an outer conditional.
The testcase from pr6198 does not crash for me -- I don't know what's up with
that -- so I'm not adding it to the tests.

llvm-svn: 94984
2010-02-01 17:41:44 +00:00
Dan Gohman
d1d30c5ec2 Add a getNUWMul function.
llvm-svn: 94982
2010-02-01 16:38:14 +00:00
Dan Gohman
9026a494ae Add a generalized form of ConstantExpr::getOffsetOf which works for
array types as well as struct types, and which accepts arbitrary
Constant indicies.  

llvm-svn: 94981
2010-02-01 16:37:38 +00:00
Bruno Cardoso Lopes
7099d40968 MulOp is actually a Mips specific node, so do the match using Opcode. This fixes PR6192
llvm-svn: 94977
2010-02-01 12:16:39 +00:00
Evan Cheng
dcc1816642 Undo r94946 now all the tests are passing again.
llvm-svn: 94970
2010-02-01 02:13:39 +00:00
Bruno Cardoso Lopes
2a49e86448 Fix stack size bug while using o32 abi
llvm-svn: 94969
2010-02-01 02:03:24 +00:00
Johnny Chen
15f2bf96d8 For MVNr and MVNs, we need to set Inst{25} = 0 so as not to confuse the decoder.
llvm-svn: 94955
2010-01-31 11:22:28 +00:00
Evan Cheng
e86a191862 Change TAILJMP's to be varargs and transfer implicit uses over from TCRETURN's. Otherwise the missing uses can make post-regalloc scheduling do bad things. This fixes 403.gcc.
llvm-svn: 94950
2010-01-31 07:28:44 +00:00
Evan Cheng
c3c18b9fe9 Fix a missing check from my last commit.
llvm-svn: 94949
2010-01-31 07:27:31 +00:00
Evan Cheng
b5f97d871c Avoid recursive sibcall's.
llvm-svn: 94946
2010-01-31 06:44:49 +00:00
Eli Friedman
28884d637b Remove a completed item, add a couple new ones.
llvm-svn: 94945
2010-01-31 04:55:32 +00:00
Eli Friedman
19c5c57885 Simplify/generalize the xor+add->sign-extend instcombine.
llvm-svn: 94943
2010-01-31 04:29:12 +00:00
Eli Friedman
58c7936637 Add a small transform: transform -(X<<Y) to (-X<<Y) when the shift has a single
use and X is free to negate.

llvm-svn: 94941
2010-01-31 02:30:23 +00:00
Sean Callanan
5458663492 Moved InstallLexer() from the X86-specific AsmLexer
to the TargetAsmLexer class so that clients can
actually use the TargetAsmLexer they get from a
Target.

llvm-svn: 94940
2010-01-31 02:28:18 +00:00
Evan Cheng
c2f3c20680 Do not mark no-return calls tail calls. It'll screw up special calls like longjmp and it doesn't make much sense for performance reason. If my logic is faulty, please let me know.
llvm-svn: 94937
2010-01-31 00:59:31 +00:00
Bruno Cardoso Lopes
dcd6d1450f Fix PR6144. Reload GP before the emission of CALLSEQ_END to guarantee the right reload order
llvm-svn: 94915
2010-01-30 18:32:07 +00:00
Bruno Cardoso Lopes
a82b8ade4d Fix mov.d out register by using the FFR register class directly
llvm-svn: 94914
2010-01-30 18:29:19 +00:00
Anton Korobeynikov
f7651ec593 Fix a gross typo: ARMv6+ may or may not support unaligned memory operations.
Even if they are suported by the core, they can be disabled
(this is just a configuration bit inside some register).

Allow unaligned memops on darwin and conservatively disallow them otherwise.

llvm-svn: 94889
2010-01-30 14:08:12 +00:00
Bob Wilson
0f04082970 Check alignment of loads when deciding whether it is safe to execute them
unconditionally.  Besides checking the offset, also check that the underlying
object is aligned as much as the load itself.

llvm-svn: 94875
2010-01-30 04:42:39 +00:00
Evan Cheng
40ae22e14d Allow more tailcall optimization: calls with inputs that are all passed in registers.
llvm-svn: 94873
2010-01-30 01:22:00 +00:00
Evan Cheng
5acba193ef Don't forget to transfer target flag when inserting a tailcall instruction.
llvm-svn: 94872
2010-01-30 01:16:15 +00:00
Devang Patel
70713c75da Emit declaration DIE for the class static variables.
llvm-svn: 94870
2010-01-30 01:08:30 +00:00
Daniel Dunbar
23e8bc782c MC/X86 AsmParser: Handle absolute memory operands correctly. We were doing
something totally broken and parsing them as immediates, but the .td file also
had the wrong match class so things sortof worked. Except, that is, that we
would parse
  movl $0, %eax
as
  movl 0, %eax
Feel free to guess how well that worked.

llvm-svn: 94869
2010-01-30 01:02:48 +00:00
Dale Johannesen
9774a29dc0 Fix a case where debug_value could affect codegen.
llvm-svn: 94866
2010-01-30 00:57:47 +00:00
Bob Wilson
e979c978e0 Use more specific types to avoid casts. No functionality change.
llvm-svn: 94863
2010-01-30 00:41:10 +00:00
Daniel Dunbar
ee85d3388b X86.td: Refactor to bring operands that use print_pcrel_imm together.
llvm-svn: 94861
2010-01-30 00:24:12 +00:00
Daniel Dunbar
e92f9cffdb AsmMatcher/X86: Separate out sublass for memory operands that have no segment
register, and use to cleanup a FIXME in X86AsmParser.cpp.

llvm-svn: 94859
2010-01-30 00:24:00 +00:00
Jakob Stoklund Olesen
e3fd8b5848 Keep iterating over all uses when meeting a phi node in AllUsesOfValueWillTrapIfNull().
This bug was exposed by my inliner cost changes in r94615, and caused failures
of lencod on most architectures when building with LTO.

This patch fixes lencod and 464.h264ref on x86-64 (and likely others).

llvm-svn: 94858
2010-01-29 23:54:14 +00:00
Johnny Chen
377da9a33c Modified encoding bits specification for VFP instructions. In particular, the D
bit (Inst{22}) and the M bit (Inst{5}) should be left unspecified.  For binary
format instructions, Inst{6} and Inst{4} need to specified for proper decodings.

llvm-svn: 94855
2010-01-29 23:21:10 +00:00
Dan Gohman
c5a2b73589 Print a comment next to "materializable" global values, to distinguish
them from values that are not actually defined in the module.

llvm-svn: 94854
2010-01-29 23:12:36 +00:00
Evan Cheng
5964860340 PPC is not ready for sibcall optimization.
llvm-svn: 94853
2010-01-29 23:05:56 +00:00
Bob Wilson
71bc5f0787 Preserve load alignment in instcombine transformations. I've been unable to
create a testcase where this matters.  The select+load transformation only
occurs when isSafeToLoadUnconditionally is true, and in those situations,
instcombine also changes the underlying objects to be aligned.  This seems
like a good idea regardless, and I've verified that it doesn't pessimize
the subsequent realignment.

llvm-svn: 94850
2010-01-29 22:39:21 +00:00
Dale Johannesen
9e9159cd4d Add assertion to humor the paranoid.
llvm-svn: 94843
2010-01-29 21:21:28 +00:00
Victor Hernandez
8102f790ac We were not writing bitcode for function-local metadata whose operands have been erased (making it not have any more function-local operands)
llvm-svn: 94842
2010-01-29 21:19:19 +00:00
Eric Christopher
47d90f7adb Revert my last couple of patches. They appear to have broken bison.
llvm-svn: 94841
2010-01-29 21:16:24 +00:00
Bob Wilson
bb651db10d Use uint64_t instead of unsigned for offsets and sizes.
llvm-svn: 94835
2010-01-29 20:34:28 +00:00
Bob Wilson
f897b7b37e Improve isSafeToLoadUnconditionally to recognize that GEPs with constant
indices are safe if the result is known to be within the bounds of the
underlying object.

llvm-svn: 94829
2010-01-29 19:19:08 +00:00
Devang Patel
022d4a7fc0 Add size and location info in DW_TAG_class_type descriptor.
llvm-svn: 94822
2010-01-29 18:34:58 +00:00
Devang Patel
c91ba40a59 Before inserting llvm.dbg.declare intrinsic at the end of a basic block, check whether the basic block has a terminator or not.
This API is used by clang and the test case is test/CodeGen/debug-info-crash.c in clang module.

llvm-svn: 94820
2010-01-29 18:30:57 +00:00
Benjamin Kramer
fbfb029ab0 Fix MSVC build.
llvm-svn: 94809
2010-01-29 15:19:06 +00:00
Benjamin Kramer
cae092b08b Convert some users of ftostr to raw_ostream.
llvm-svn: 94808
2010-01-29 14:42:22 +00:00
Benjamin Kramer
326bcaa5f9 Use llvm::format instead of ftostr (which just calls sprintf).
llvm-svn: 94807
2010-01-29 14:40:33 +00:00
Duncan Sands
6b277c2823 Change the SREM case to match the logic in the IR version ComputeMaskedBits.
llvm-svn: 94805
2010-01-29 09:45:26 +00:00
Evan Cheng
2cbd1b19db Catch more trivial tail call opportunities: no inputs and output types match.
llvm-svn: 94804
2010-01-29 06:45:59 +00:00