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

15 Commits

Author SHA1 Message Date
Hal Finkel
6d75832312 Don't assert if we can't constant fold extract/insertvalue
A non-constant-foldable static initializer expression containing insertvalue or
extractvalue had been causing an assert:

  Constants.cpp:1971: Assertion `FC && "ExtractValue constant expr couldn't be
                                 folded!"' failed.

Now we report a more-sensible "Unsupported expression in static initializer"
error instead.

Fixes PR15417.

llvm-svn: 186044
2013-07-10 22:51:01 +00:00
Derek Schuff
a5f20f3678 Fix DeleteDeadVarargs not to crash on functions referenced by BlockAddresses
This pass was assuming that if hasAddressTaken() returns false for a
function, the function's only uses are call sites.  That's not true
because there can be references by BlockAddresses too.

Fix the pass to handle this case.  Fix
BlockAddress::replaceUsesOfWithOnConstant() to allow a function's type
to be changed by RAUW'ing the function with a bitcast of the recreated
function.

Patch by Mark Seaborn.

llvm-svn: 183933
2013-06-13 19:51:17 +00:00
Benjamin Kramer
1fa157140a Move object construction into [] so the temporary can be moved.
No functionality change.

llvm-svn: 183075
2013-06-01 17:51:03 +00:00
Benjamin Kramer
fedd86f086 Fix a scalability issue with complex ConstantExprs.
This is basically the same fix in three different places. We use a set to avoid
walking the whole tree of a big ConstantExprs multiple times.

For example: (select cmp, (add big_expr 1), (add big_expr 2))
We don't want to visit big_expr twice here, it may consist of thousands of
nodes.

The testcase exercises this by creating an insanely large ConstantExprs out of
a loop. It's questionable if the optimizer should ever create those, but this
can be triggered with real C code. Fixes PR15714.

llvm-svn: 179458
2013-04-13 12:53:18 +00:00
David Tweed
5652836d44 The testing to ensure a vector of zeros of type floating point isn't misclassified as negative zero can be simplified, as pointed out by Duncan Sands.
llvm-svn: 177386
2013-03-19 10:16:40 +00:00
David Tweed
1904cbefd1 The optimization a + (-0.0f) -> a was being misapplied to a + (+0.0f) in the vector case (because
we weren't differntiating floating-point zeroinitializers from other zero-initializers)
which was causing problems for code relying upon a + (+0.0f) to, eg, flush denormals to
0. Make the scalar and vector cases have the same behaviour.

llvm-svn: 177279
2013-03-18 11:54:44 +00:00
Benjamin Kramer
91b6dfab6b Replace temporary vectors with arrays.
llvm-svn: 176651
2013-03-07 20:53:34 +00:00
Nadav Rotem
1a77ebbc40 ArrayRef has a OneElt constructor. Beautify the code.
llvm-svn: 176604
2013-03-07 01:38:04 +00:00
Nadav Rotem
a79262c9eb Switch from std::vector to ArrayRef. Speedup FoldBitCast by 5x.
llvm-svn: 176602
2013-03-07 01:30:40 +00:00
Tim Northover
52ba1e77cb Make APFloat constructor require explicit semantics.
Previously we tried to infer it from the bit width size, with an added
IsIEEE argument for the PPC/IEEE 128-bit case, which had a default
value. This default value allowed bugs to creep in, where it was
inappropriate.

llvm-svn: 173138
2013-01-22 09:46:31 +00:00
Evgeniy Stepanov
044fd8aa94 Allow vectors in CreatePointerCast of constants.
llvm-svn: 172615
2013-01-16 14:41:46 +00:00
Shuxin Yang
f10c29887b Add comment to the definition of Constant::isZeroValue().
(There already has a concise comment to the declaration.)

Thank Eric Christopher for his feedback!

llvm-svn: 171926
2013-01-09 00:53:25 +00:00
Shuxin Yang
2dc1fb7889 Consider expression "0.0 - X" as the negation of X if
- this expression is explicitly marked no-signed-zero, or
  - no-signed-zero of this expression can be derived from some context.

llvm-svn: 171922
2013-01-09 00:13:41 +00:00
Chandler Carruth
4c1f3c24db Move all of the header files which are involved in modelling the LLVM IR
into their new header subdirectory: include/llvm/IR. This matches the
directory structure of lib, and begins to correct a long standing point
of file layout clutter in LLVM.

There are still more header files to move here, but I wanted to handle
them in separate commits to make tracking what files make sense at each
layer easier.

The only really questionable files here are the target intrinsic
tablegen files. But that's a battle I'd rather not fight today.

I've updated both CMake and Makefile build systems (I think, and my
tests think, but I may have missed something).

I've also re-sorted the includes throughout the project. I'll be
committing updates to Clang, DragonEgg, and Polly momentarily.

llvm-svn: 171366
2013-01-02 11:36:10 +00:00
Chandler Carruth
1879729aa9 Rename VMCore directory to IR.
Aside from moving the actual files, this patch only updates the build
system and the source file comments under lib/... that are relevant.

I'll be updating other docs and other files in smaller subsequnet
commits.

While I've tried to test this, but it is entirely possible that there
will still be some build system fallout.

Also, note that I've not changed the library name itself: libLLVMCore.a
is still the library name. I'd be interested in others' opinions about
whether we should rename this as well (I think we should, just not sure
what it might break)

llvm-svn: 171359
2013-01-02 09:10:48 +00:00