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

518 Commits

Author SHA1 Message Date
Chris Lattner
a4599933fa eliminate the Constant::getVectorElements method. There are better (and
more robust) ways to do what it was doing now.  Also, add static methods
for decoding a ShuffleVector mask.

llvm-svn: 149028
2012-01-26 02:51:13 +00:00
Chris Lattner
f2a0e16598 Add a ConstantDataVector::getSplatValue() method, for parity with
ConstantVector.  Fix some outright bugs in the implementation of
ConstantArray and Constant struct, which would cause us to not make
one big UndefValue when asking for an array/struct with all undef
elements.  Enhance Constant::isAllOnesValue to work with
ConstantDataVector.

llvm-svn: 149021
2012-01-26 02:31:22 +00:00
Chris Lattner
1c318c6440 some general cleanup, using new methods and tidying up old code.
llvm-svn: 149006
2012-01-26 00:42:34 +00:00
Chris Lattner
6791b23efa constify some methods and add a new Constant::getAggregateElement
helper method for the common operation of extracting an element
out of a constant aggregate.

llvm-svn: 148931
2012-01-25 06:16:32 +00:00
Chris Lattner
276264ed59 reapply r148901 with a crucial fix.
"Introduce a new ConstantVector::getSplat constructor function to 
simplify a really common case."

llvm-svn: 148924
2012-01-25 05:19:54 +00:00
Nick Lewycky
8b7c7ba376 Fix assert("msg"). Fix unused-variable warnings complaining about VT used only
in asserts.

llvm-svn: 148910
2012-01-25 03:20:12 +00:00
Argyrios Kyrtzidis
c5d8deed3f Revert r148901 because it crashes llvm tests.
Original log:
    Introduce a new ConstantVector::getSplat constructor function to
    simplify a really common case.

llvm-svn: 148906
2012-01-25 02:42:41 +00:00
Chris Lattner
33f1fdff02 Introduce a new ConstantVector::getSplat constructor function to
simplify a really common case.

llvm-svn: 148901
2012-01-25 01:53:58 +00:00
Chris Lattner
884a2b01e2 Remove the Type::getNumElements() method, which is only called in 4 places,
did something extremely surprising, and shadowed actually useful 
implementations that had completely different behavior.

llvm-svn: 148898
2012-01-25 01:32:59 +00:00
Chris Lattner
c67dced045 C++, CBE, and TLOF support for ConstantDataSequential
llvm-svn: 148805
2012-01-24 14:17:05 +00:00
Chris Lattner
70c46f210a Rearrange argument order of ::get methods so that LLVMContext comes first,
add a ConstantDataArray::getString method that corresponds to the (to be
removed) StringRef version of ConstantArray::get, but is dramatically more 
efficient.

llvm-svn: 148804
2012-01-24 14:04:40 +00:00
Chris Lattner
9713727d0b add more support for ConstantDataSequential
llvm-svn: 148802
2012-01-24 13:41:11 +00:00
Chris Lattner
55e4ae9dcd Add AsmPrinter (aka MCLowering) support for ConstantDataSequential,
and clean up some other misc stuff.  Unlike ConstantArray, we will
prefer to emit .fill directives for "String" arrays that all have
the same value, since they are denser than emitting a .ascii

llvm-svn: 148793
2012-01-24 09:31:43 +00:00
Chris Lattner
c616f8a90f Add various "string" methods to ConstantDataSequential, which have the
same semantics as ConstantArray's but much more efficient because they
don't have to return std::string's.  The ConstantArray methods will
eventually be removed.

llvm-svn: 148792
2012-01-24 09:01:07 +00:00
Chris Lattner
e9cf212d3f teach valuetracking about ConstantDataSequential
llvm-svn: 148790
2012-01-24 07:54:10 +00:00
Chris Lattner
e534fbc8f6 Add some accessor methods to CAZ and UndefValue that help simplify clients.
Make some CDS methods public.

llvm-svn: 148785
2012-01-24 05:42:11 +00:00
Chris Lattner
df67e07d2e implement the ConstantDataSequential accessor methods.
No need for 'getOperand' :)

llvm-svn: 148778
2012-01-24 04:43:41 +00:00
Chris Lattner
860d90844c start the implementation of a new ConstantDataVector and ConstantDataArray
classes, per PR1324.  Not all of their helper functions are implemented,
nothing creates them, and the rest of the compiler doesn't handle them yet.

llvm-svn: 148741
2012-01-23 22:57:10 +00:00
Chris Lattner
6d71b145da convert CAZ, UndefValue, and CPN to use DenseMap's again, this time without
using OwningPtr.  OwningPtr would barf when the densemap had to reallocate,
which doesn't appear to happen on the regression test suite, but obviously
happens in real life :)

llvm-svn: 148700
2012-01-23 15:20:12 +00:00
Chris Lattner
4dbbd66de9 revert r148691 and 148693
llvm-svn: 148698
2012-01-23 15:09:44 +00:00
Chris Lattner
7cf6171afa switch UndefValue and ConstantPointerNull over to DenseMap's for uniquing.
llvm-svn: 148693
2012-01-23 08:52:32 +00:00
Chris Lattner
395d1616b3 Replace a use of ConstantUniqueMap for CAZ constants with a simple DenseMap.
Now that the type system rewrite has landed, there is no need for its
complexity and std::map'ness.

llvm-svn: 148691
2012-01-23 08:42:38 +00:00
David Blaikie
06ecc99a56 More dead code removal (using -Wunreachable-code)
llvm-svn: 148578
2012-01-20 21:51:11 +00:00
David Blaikie
576aba04f1 Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch
llvm-svn: 146960
2011-12-20 02:50:00 +00:00
Dan Gohman
9c8c9a8f62 The powers that be have decided that LLVM IR should now support 16-bit
"half precision" floating-point with a first-class type.

This patch adds basic IR support (but not codegen support).

llvm-svn: 146786
2011-12-17 00:04:22 +00:00
Nadav Rotem
1a91e4381d Add support for vectors of pointers.
llvm-svn: 145801
2011-12-05 06:29:09 +00:00
Benjamin Kramer
720b712c77 Fold ConstantVector::isAllOnesValue into Constant::isAllOnesValue and simplify it.
llvm-svn: 144555
2011-11-14 19:12:20 +00:00
Richard Trieu
a675de9fac Change:
assert(!"error message");

To:

  assert(0 && "error message");

which is more consistant across the code base.

llvm-svn: 140234
2011-09-21 03:09:09 +00:00
Nadav Rotem
43673d6d0b Implement Constant::isAllOnesValue(). Fix ConstantFolding to use the new api.
llvm-svn: 138469
2011-08-24 20:18:38 +00:00
Eric Christopher
aa4993b9aa Revert "Address Duncan's CR request:"
This reverts commit 20a05be15ea5271ab6185b83200fa88263362400. (svn rev 138340)

Conflicts:

	test/Transforms/InstCombine/bitcast.ll

llvm-svn: 138366
2011-08-23 20:11:10 +00:00
Nadav Rotem
d449bc9bff Address Duncan's CR request:
1. Cleanup the tests in ConstantFolding.cpp
2. Implement isAllOnes for Constant, ConstantFP, ConstantVector

llvm-svn: 138340
2011-08-23 17:48:43 +00:00
Chris Lattner
5099413082 strengthen up an assertion: you can't create a constant struct
with an opaque struct type, it doesn't make sense.  This should
resolve PR10473.

llvm-svn: 137028
2011-08-07 04:18:48 +00:00
Jay Foad
4f279f9a6f Use ArrayRef in the (protected) constructors of ConstantArray, ConstantStruct and ConstantVector.
llvm-svn: 135905
2011-07-25 10:14:44 +00:00
Jay Foad
6513dac6e2 Convert GetElementPtrInst to use ArrayRef.
llvm-svn: 135904
2011-07-25 09:48:08 +00:00
Jay Foad
42eb18b051 Make better use of ConstantExpr::getGetElementPtr's InBounds parameter.
llvm-svn: 135676
2011-07-21 15:15:37 +00:00
Jay Foad
d4458dd707 Convert ConstantExpr::getGetElementPtr and
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef.

llvm-svn: 135673
2011-07-21 14:31:17 +00:00
Jay Foad
6d007bef3c Convert ConstantFoldGetElementPtr to use ArrayRef.
llvm-svn: 135483
2011-07-19 15:30:30 +00:00
Chris Lattner
e1fe7061ce land David Blaikie's patch to de-constify Type, with a few tweaks.
llvm-svn: 135375
2011-07-18 04:54:35 +00:00
Chris Lattner
1810c19d8e tidy up
llvm-svn: 135360
2011-07-17 06:01:30 +00:00
Chris Lattner
609591194a remove the old and dangerous uncheckedReplaceAllUsesWith method,
which was just replaceAllUsesWith without some assertions.  It was
needed back when type refinement was alive.

llvm-svn: 135253
2011-07-15 06:18:52 +00:00
Chris Lattner
6274327fff devirtualize Constant::isNullValue:
4 files changed, 15 insertions(+), 60 deletions(-)

llvm-svn: 135252
2011-07-15 06:14:08 +00:00
Chris Lattner
e99d93799f add CFP::isNegative() and ConstnatInt::isNegative() methods.
Devirtualize the isNegativeZeroValue method.

llvm-svn: 135249
2011-07-15 05:58:04 +00:00
Jay Foad
88fb4f4597 Convert InsertValueInst and ExtractValueInst APIs to use ArrayRef.
llvm-svn: 135040
2011-07-13 10:26:04 +00:00
Jay Foad
cbe48cd2ac Second attempt at de-constifying LLVM Types in FunctionType::get(),
StructType::get() and TargetData::getIntPtrType().

llvm-svn: 134982
2011-07-12 14:06:48 +00:00
Chris Lattner
ea8905f182 simplify assertions to not be completely redundant.
llvm-svn: 134968
2011-07-12 05:26:21 +00:00
Bill Wendling
6bcdd65b95 Revert r134893 and r134888 (and related patches in other trees). It was causing
an assert on Darwin llvm-gcc builds.

Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.llvm-gcc-i386-darwin9-RA/llvm.src/lib/VMCore/Instructions.cpp, li\
ne 2067.
etc.

http://smooshlab.apple.com:8013/builders/llvm-gcc-i386-darwin9-RA/builds/2354

--- Reverse-merging r134893 into '.':
U    include/llvm/Target/TargetData.h
U    include/llvm/DerivedTypes.h
U    tools/bugpoint/ExtractFunction.cpp
U    unittests/Support/TypeBuilderTest.cpp
U    lib/Target/ARM/ARMGlobalMerge.cpp
U    lib/Target/TargetData.cpp
U    lib/VMCore/Constants.cpp
U    lib/VMCore/Type.cpp
U    lib/VMCore/Core.cpp
U    lib/Transforms/Utils/CodeExtractor.cpp
U    lib/Transforms/Instrumentation/ProfilingUtils.cpp
U    lib/Transforms/IPO/DeadArgumentElimination.cpp
U    lib/CodeGen/SjLjEHPrepare.cpp
--- Reverse-merging r134888 into '.':
G    include/llvm/DerivedTypes.h
U    include/llvm/Support/TypeBuilder.h
U    include/llvm/Intrinsics.h
U    unittests/Analysis/ScalarEvolutionTest.cpp
U    unittests/ExecutionEngine/JIT/JITTest.cpp
U    unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp
U    unittests/VMCore/PassManagerTest.cpp
G    unittests/Support/TypeBuilderTest.cpp
U    lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp
U    lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp
U    lib/VMCore/IRBuilder.cpp
G    lib/VMCore/Type.cpp
U    lib/VMCore/Function.cpp
G    lib/VMCore/Core.cpp
U    lib/VMCore/Module.cpp
U    lib/AsmParser/LLParser.cpp
U    lib/Transforms/Utils/CloneFunction.cpp
G    lib/Transforms/Utils/CodeExtractor.cpp
U    lib/Transforms/Utils/InlineFunction.cpp
U    lib/Transforms/Instrumentation/GCOVProfiling.cpp
U    lib/Transforms/Scalar/ObjCARC.cpp
U    lib/Transforms/Scalar/SimplifyLibCalls.cpp
U    lib/Transforms/Scalar/MemCpyOptimizer.cpp
G    lib/Transforms/IPO/DeadArgumentElimination.cpp
U    lib/Transforms/IPO/ArgumentPromotion.cpp
U    lib/Transforms/InstCombine/InstCombineCompares.cpp
U    lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
U    lib/Transforms/InstCombine/InstCombineCalls.cpp
U    lib/CodeGen/DwarfEHPrepare.cpp
U    lib/CodeGen/IntrinsicLowering.cpp
U    lib/Bitcode/Reader/BitcodeReader.cpp

llvm-svn: 134949
2011-07-12 01:15:52 +00:00
Jay Foad
0ec904296e De-constify Types in StructType::get() and TargetData::getIntPtrType().
llvm-svn: 134893
2011-07-11 09:56:20 +00:00
Chandler Carruth
13436db634 Silence -Wunused-variable in release builds.
llvm-svn: 134868
2011-07-10 09:45:35 +00:00
Chris Lattner
53eb6acc7c the various ConstantExpr::get*Ty methods existed to work with issues around
type refinement.  Zap them now that type refinement is toast.

llvm-svn: 134837
2011-07-09 18:23:52 +00:00
Chris Lattner
a106725fc5 Land the long talked about "type system rewrite" patch. This
patch brings numerous advantages to LLVM.  One way to look at it
is through diffstat:
 109 files changed, 3005 insertions(+), 5906 deletions(-)

Removing almost 3K lines of code is a good thing.  Other advantages
include:

1. Value::getType() is a simple load that can be CSE'd, not a mutating
   union-find operation.
2. Types a uniqued and never move once created, defining away PATypeHolder.
3. Structs can be "named" now, and their name is part of the identity that
   uniques them.  This means that the compiler doesn't merge them structurally
   which makes the IR much less confusing.
4. Now that there is no way to get a cycle in a type graph without a named
   struct type, "upreferences" go away.
5. Type refinement is completely gone, which should make LTO much MUCH faster
   in some common cases with C++ code.
6. Types are now generally immutable, so we can use "Type *" instead 
   "const Type *" everywhere.

Downsides of this patch are that it removes some functions from the C API,
so people using those will have to upgrade to (not yet added) new API.  
"LLVM 3.0" is the right time to do this.

There are still some cleanups pending after this, this patch is large enough
as-is.

llvm-svn: 134829
2011-07-09 17:41:24 +00:00