Ted Kremenek
ec144538ae
Make sure this test case tests analyzing both x86_64 and i386 archs.
...
llvm-svn: 93133
2010-01-10 22:31:25 +00:00
Chris Lattner
7dd540ee24
teach sext optimization to handle truncs from types that are not
...
the dest of the sext.
llvm-svn: 93128
2010-01-10 20:30:41 +00:00
Chris Lattner
39d2daa94c
teach zext optimization how to deal with truncs that don't come from
...
the zext dest type. This allows us to handle test52/53 in cast.ll,
and allows llvm-gcc to generate much better code for PR4216 in -m64
mode:
_test_bitfield: ## @test_bitfield
orl $32962, %edi
movl %edi, %eax
andl $-25350, %eax
ret
This also fixes a bug handling vector extends, ensuring that the
mask produced is a vector constant, not an integer constant.
llvm-svn: 93127
2010-01-10 20:25:54 +00:00
Chris Lattner
5370ae7b70
fix a buggy assertion, CreateIntegerCast should allow
...
integer vectors as well as just integers.
llvm-svn: 93126
2010-01-10 20:21:42 +00:00
Benjamin Kramer
e056cea3a6
Silence MSVC warning.
...
RewriteObjC.cpp(4419) : warning C4804: '>' : unsafe use of type 'bool' in operation
llvm-svn: 93124
2010-01-10 19:57:50 +00:00
Mikhail Glushenkov
ed3bd13c3a
Suppress a warning on gcc 4.4.
...
warning: suggest parentheses around ‘&&’ within ‘||’.
llvm-svn: 93121
2010-01-10 18:48:49 +00:00
Anton Korobeynikov
3d364fddda
Make clone() method out-of-line for Attr classes.
...
llvm-svn: 93120
2010-01-10 14:38:13 +00:00
Anton Korobeynikov
b322c3a34b
Try to make cmake happy
...
llvm-svn: 93119
2010-01-10 13:06:34 +00:00
Anton Korobeynikov
55bcea1e65
Generalize target weirdness handling having proper layering in mind:
...
1. Add helper class for sema checks for target attributes
2. Add helper class for codegen of target attributes
As a proof-of-concept - implement msp430's 'interrupt' attribute.
llvm-svn: 93118
2010-01-10 12:58:08 +00:00
Anton Korobeynikov
89b14a4309
Rename file to generalization in next commits
...
llvm-svn: 93117
2010-01-10 12:57:30 +00:00
Benjamin Kramer
307c2c7ebc
Simplify code. No functionality change.
...
llvm-svn: 93114
2010-01-10 09:51:00 +00:00
Chris Lattner
1a05fddcdc
simplify CanEvaluateSExtd to return a bool now that we have a
...
simpler profitability predicate.
llvm-svn: 93111
2010-01-10 07:57:20 +00:00
Chris Lattner
d7816780e2
the NumCastsRemoved argument to CanEvaluateSExtd is dead, remove it.
...
llvm-svn: 93110
2010-01-10 07:42:21 +00:00
Chris Lattner
2fff10c424
now that the cost model has changed, we can always consider
...
elimination of a sign extend to be a win, which simplifies
the client of CanEvaluateSExtd, and allows us to eliminate
more casts (examples taken from real code).
llvm-svn: 93109
2010-01-10 07:40:50 +00:00
Victor Hernandez
b8fd152d94
Compute isFunctionLocal in MDNode ctor or via argument in new function getWhenValsUnresolved().
...
Document PFS argument to ParseValID() and ConvertGlobalOrMetadataValIDToValue().
llvm-svn: 93108
2010-01-10 07:14:18 +00:00
Chris Lattner
d8509424a4
change the preferred canonical form for a sign extension to be
...
lshr+ashr instead of trunc+sext. We want to avoid type
conversions whenever possible, it is easier to codegen expressions
without truncates and extensions.
llvm-svn: 93107
2010-01-10 07:08:30 +00:00
Chris Lattner
2b459fe7e1
fix indentation of switch statements, no functionality change.
...
llvm-svn: 93106
2010-01-10 06:59:55 +00:00
Chris Lattner
127bbc715e
fix pasto that broke bootstrap.
...
llvm-svn: 93105
2010-01-10 06:50:04 +00:00
Zhongxing Xu
9635f6f5ef
Enhance test case.
...
llvm-svn: 93101
2010-01-10 02:52:56 +00:00
Chris Lattner
b7be7cc486
simplify CanEvaluateZExtd now that we don't care about the number of
...
bits known clear in the result and don't care about the # casts
eliminated. TD is also dead but keeping it for now.
llvm-svn: 93098
2010-01-10 02:50:04 +00:00
Chris Lattner
49d2c9764d
two changes:
...
1) don't try to optimize a sext or zext that is only used by a trunc, let
the trunc get optimized first. This avoids some pointless effort in
some common cases since instcombine scans down a block in the first pass.
2) Change the cost model for zext elimination to consider an 'and' cheaper
than a zext. This allows us to do it more aggressively, and for the next
patch to simplify the code quite a bit.
llvm-svn: 93097
2010-01-10 02:39:31 +00:00
Chris Lattner
f0af17dab3
enhance CanEvaluateZExtd to handle shift left and sext, allowing
...
more expressions to be promoted and casts eliminated.
llvm-svn: 93096
2010-01-10 02:22:12 +00:00
Chris Lattner
7723e2b10f
remove an xform subsumed by EvaluateInDifferentType.
...
llvm-svn: 93095
2010-01-10 01:35:55 +00:00
Chris Lattner
d081f8c851
stringref'ize a bunch of filename handling logic. Much
...
nicer than passing around two const char*'s.
llvm-svn: 93094
2010-01-10 01:35:12 +00:00
Julien Lerouge
321098ebec
Fix nondeterministic behavior.
...
llvm-svn: 93093
2010-01-10 01:07:22 +00:00
Chris Lattner
c95a7a21b7
clean up this xform by using m_Trunc.
...
llvm-svn: 93092
2010-01-10 01:04:31 +00:00
Chris Lattner
883550afe8
inline and remove the rest of commonIntCastTransforms.
...
llvm-svn: 93091
2010-01-10 01:00:46 +00:00
Chris Lattner
e0d2e342b3
try to make this more stable?
...
llvm-svn: 93090
2010-01-10 00:59:17 +00:00
Chris Lattner
c3aca38468
Inline the expression type promotion/demotion stuff out of
...
commonIntCastTransforms into the callers, eliminating a switch,
and allowing the static predicate methods to be moved down to
live next to the corresponding function. No functionality
change.
llvm-svn: 93089
2010-01-10 00:58:42 +00:00
Daniel Dunbar
d281a7146a
Fix PR5982, a refacto in checking for '=' in a -D argument.
...
llvm-svn: 93088
2010-01-10 00:46:21 +00:00
Daniel Dunbar
620327d66b
Fix a FIXME.
...
llvm-svn: 93087
2010-01-10 00:46:10 +00:00
Daniel Dunbar
1c4788b66b
Darwin/ld: Don't pass '-weak_reference_mismatches non-weak' when
...
-weak_reference_mismatches is not present, it is the default.
llvm-svn: 93086
2010-01-10 00:46:00 +00:00
Chris Lattner
062a721c46
add comment to test.
...
llvm-svn: 93085
2010-01-10 00:36:16 +00:00
Chris Lattner
abcbb7c05b
clarify comment.
...
llvm-svn: 93084
2010-01-10 00:35:27 +00:00
Chris Lattner
2ceb625f59
implement rdar://7520940: published framework headers should
...
import other headers within the same framework with the full
framework path, not with a relative include.
llvm-svn: 93083
2010-01-10 00:24:58 +00:00
Chris Lattner
51c49960a5
hopefully unbreak the ocaml bindings.
...
llvm-svn: 93082
2010-01-09 23:25:21 +00:00
Ted Kremenek
c6aa800eb3
Fix overzealous assertion in GRExprEngine::VisitLValue(). A
...
CallExpr/ObjCMessageExpr can be visited in an "lvalue" context if it
returns a struct temporary. Currently the analyzer doesn't reason
about struct temporary returned by function calls, but we shouldn't
crash here either.
llvm-svn: 93081
2010-01-09 22:58:54 +00:00
Chris Lattner
2bfa167d43
add 3 passes which have been added but aren't used afaik.
...
llvm-svn: 93080
2010-01-09 22:30:40 +00:00
Chris Lattner
25963c6113
"In order to ease automatic bindings generation, it would be helpful if boolean values were distinguishable from integers. The attached patch introduces "typedef int LLVMBool;", and uses LLVMBool instead of int throughout the C API, wherever a boolean value is called for."
...
Patch by James Y Knight!
llvm-svn: 93079
2010-01-09 22:27:07 +00:00
Chris Lattner
e23003d1f1
implement -ftabstop=width, patch by Christian Adåker
...
llvm-svn: 93078
2010-01-09 21:54:33 +00:00
Chris Lattner
b71980f888
revert 91891, a workaround for PR5514.
...
llvm-svn: 93077
2010-01-09 21:45:57 +00:00
Chris Lattner
bb8976e36e
implement codegen support for preinc as an lvalue, PR5514.
...
llvm-svn: 93076
2010-01-09 21:44:40 +00:00
Chris Lattner
116ce8f172
refactor pre/postinc logic into CGF and require the caller to pass in the
...
lvalue to poke, no functionality change.
llvm-svn: 93075
2010-01-09 21:40:03 +00:00
Chris Lattner
34c72dd683
revert r92749, which is just dead code.
...
llvm-svn: 93074
2010-01-09 21:14:47 +00:00
Chris Lattner
5ed4390474
make missing prototypes warn by default in c99 mode like GCC does,
...
rdar://7083878
llvm-svn: 93073
2010-01-09 20:43:38 +00:00
Chris Lattner
f9895c48fd
add a bunch of missing prototypes to tests
...
llvm-svn: 93072
2010-01-09 20:43:19 +00:00
Ted Kremenek
9aa01441c3
Fix broken diagnostic when returning the address of a stack-allocated array.
...
llvm-svn: 93071
2010-01-09 20:05:00 +00:00
Jeffrey Yasskin
b867746a05
Clarify the requirements for a "tail call" to actually be optimized into a
...
jump. People clearly weren't finding the extra requirements in
CodeGenerator.html.
llvm-svn: 93070
2010-01-09 19:44:16 +00:00
Chris Lattner
23ac41e8f0
fix bogus test
...
llvm-svn: 93069
2010-01-09 19:24:49 +00:00
Chris Lattner
6a7384357f
fix bogus test
...
llvm-svn: 93068
2010-01-09 19:24:18 +00:00