summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert "InstCombine: Turn mul.with.overflow(X, 2) into the cheaper ↵Benjamin Kramer2011-05-211-14/+0
| | | | | | | | add.with.overflow(X, X)" It's better to do this in codegen, mul.with.overflow(X, 2) is more canonical because it has only one use on "X". llvm-svn: 131798
* InstCombine: Turn mul.with.overflow(X, 2) into the cheaper ↵Benjamin Kramer2011-05-211-0/+14
| | | | | | add.with.overflow(X, X) llvm-svn: 131789
* Add comment.Evan Cheng2011-05-191-0/+1
| | | | llvm-svn: 131659
* More instcombine cleanup, towards improving debug line info.Eli Friedman2011-05-181-1/+1
| | | | llvm-svn: 131604
* More instcombine cleanup aimed towards improving debug line info.Eli Friedman2011-05-181-21/+18
| | | | llvm-svn: 131559
* Fix inelegant initialization.Stuart Hastings2011-05-181-2/+1
| | | | llvm-svn: 131538
* Start trying to make InstCombine preserve more debug info. The idea here is ↵Eli Friedman2011-05-181-5/+5
| | | | | | | | | | to set the debug location on the IRBuilder, which will be then right location in most cases. This should magically give many transformations debug locations, and fixing places which are missing a debug location will usually just means changing the code creating it to use the IRBuilder. As an example, the change to InstCombineCalls catches a common case where a call to a bitcast of a function is rewritten. Chris, does this approach look reasonable? llvm-svn: 131516
* Use ReplaceInstUsesWith instead of replaceAllUsesWith where appropriate in ↵Eli Friedman2011-05-181-6/+6
| | | | | | instcombine. llvm-svn: 131512
* X86 pmovsx/pmovzx ignore the upper half of their inputs.Stuart Hastings2011-05-171-0/+22
| | | | | | rdar://problem/6945110 llvm-svn: 131493
* Reapply r129401 with patch for clang.Bill Wendling2011-04-131-5/+1
| | | | llvm-svn: 129419
* Revert r129401 for now. Clang is using the old way of doing things.Bill Wendling2011-04-121-1/+5
| | | | llvm-svn: 129403
* Remove the unaligned load intrinsics in favor of using native unaligned loads.Bill Wendling2011-04-121-5/+1
| | | | | | | | | Now that we have a first-class way to represent unaligned loads, the unaligned load intrinsics are superfluous. First part of <rdar://problem/8460511>. llvm-svn: 129401
* Use APInt's umul_ov instead of rolling our own overflow detection.Benjamin Kramer2011-03-271-5/+6
| | | | llvm-svn: 128380
* If we don't know how long a string is we can't fold an _chk version to theEric Christopher2011-03-151-3/+7
| | | | | | | | normal version. Fixes rdar://9123638 llvm-svn: 127636
* InstCombine: Turn umul_with_overflow into mul nuw if we can prove that it ↵Benjamin Kramer2011-03-101-1/+29
| | | | | | | | | | cannot overflow. This happens a lot in clang-compiled C++ code because it adds overflow checks to operator new[]: unsigned *foo(unsigned n) { return new unsigned[n]; } We can optimize away the overflow check on 64 bit targets because (uint64_t)n*4 cannot overflow. llvm-svn: 127418
* change instcombine to not turn a call to non-varargs bitcast ofChris Lattner2011-02-241-5/+15
| | | | | | | | | function prototype into a call to a varargs prototype. We do allow the xform if we have a definition, but otherwise we don't want to risk that we're changing the abi in a subtle way. On X86-64, for example, varargs require passing stuff in %al. llvm-svn: 126363
* Teach instcombine about the rest of the SSE and SSE2 conversionChandler Carruth2011-01-101-4/+11
| | | | | | intrinsics element dependencies. Reviewed by Nick. llvm-svn: 123161
* Revert 122959, it needs more thought. Add it back to README.txt with ↵Benjamin Kramer2011-01-071-4/+0
| | | | | | additional notes. llvm-svn: 123030
* InstCombine: Turn _chk functions into the "unsafe" variant if length and max ↵Benjamin Kramer2011-01-061-0/+2
| | | | | | | | langth are equal. This happens when we take the (non-constant) length from a malloc. llvm-svn: 122961
* InstCombine: If we call llvm.objectsize on a malloc call we can replace it ↵Benjamin Kramer2011-01-061-1/+5
| | | | | | with the size passed to malloc. llvm-svn: 122959
* InstCombine: Teach llvm.objectsize folding to look through GEPs.Benjamin Kramer2011-01-061-50/+41
| | | | llvm-svn: 122958
* don't lose TD infoChris Lattner2010-12-251-2/+2
| | | | llvm-svn: 122556
* Move getOrEnforceKnownAlignment out of instcombine into Transforms/Utils.Chris Lattner2010-12-251-97/+8
| | | | llvm-svn: 122554
* fix PR8807 by making transformConstExprCastCall aware of byval arguments.Chris Lattner2010-12-201-2/+15
| | | | llvm-svn: 122238
* various cleanups for transformConstExprCastCallChris Lattner2010-12-201-13/+10
| | | | llvm-svn: 122237
* Avoid dropping the address space when InstCombine optimizes memsetMon P Wang2010-12-201-1/+3
| | | | llvm-svn: 122215
* move a transformation to a more logical place, simplifying it.Chris Lattner2010-12-191-16/+0
| | | | llvm-svn: 122183
* optimize uadd(x, cst) into a comparison when the normal Chris Lattner2010-12-191-0/+16
| | | | | | | result is dead. This is required for my next patch to not regress the testsuite. llvm-svn: 122181
* Teach instcombine to set the alignment arguments for NEON load/store intrinsics.Bob Wilson2010-10-221-0/+26
| | | | llvm-svn: 117154
* fix PR8267 - Instcombine shouldn't optimizer away volatile memcpy's.Chris Lattner2010-10-011-1/+6
| | | | llvm-svn: 115296
* PR7853: fix a silly mistake introduced in r101899, and add a test to make sureEli Friedman2010-08-091-1/+1
| | | | | | it doesn't regress again. llvm-svn: 110597
* Use unary + instead of a separate local variable for workingDan Gohman2010-08-031-2/+1
| | | | | | around std::min vs static const friction. llvm-svn: 110112
* Move MaximumAlignment to be a member of the Value class.Dan Gohman2010-07-301-1/+2
| | | | llvm-svn: 109891
* Define a maximum supported alignment value for load, store, andDan Gohman2010-07-281-1/+5
| | | | | | | | | alloca instructions (constrained by their internal encoding), and add error checking for it. Fix an instcombine bug which generated huge alignment values (null is infinitely aligned). This fixes undefined behavior noticed by John Regehr. llvm-svn: 109643
* When user code intentionally dereferences null, the alignment of theDan Gohman2010-07-281-2/+7
| | | | | | | dereference is theoretically infinite. Put a cap on the computed alignment to avoid overflow, noticed by John Regehr. llvm-svn: 109596
* undo 80 column trespassing I causedGabor Greif2010-07-221-7/+11
| | | | llvm-svn: 109092
* eliminate CallInst::ArgOffsetGabor Greif2010-07-161-3/+3
| | | | llvm-svn: 108522
* use getArgOperand (corrected by CallInst::ArgOffset) instead of getOperandGabor Greif2010-06-301-3/+3
| | | | llvm-svn: 107275
* use ArgOperand APIGabor Greif2010-06-281-12/+12
| | | | llvm-svn: 107017
* use ArgOperand API (some hunks I could split)Gabor Greif2010-06-251-13/+13
| | | | llvm-svn: 106824
* use (even more, still) ArgOperand APIGabor Greif2010-06-241-8/+8
| | | | llvm-svn: 106750
* use (even more) ArgOperand APIGabor Greif2010-06-241-5/+5
| | | | llvm-svn: 106744
* use ArgOperand APIGabor Greif2010-06-241-6/+5
| | | | llvm-svn: 106743
* use ArgOperand APIGabor Greif2010-06-241-31/+30
| | | | llvm-svn: 106740
* Teach instCombine to remove malloc+free if malloc's only uses are comparisonsDuncan Sands2010-05-271-0/+2
| | | | | | to null. Patch by Matti Niemenmaa. llvm-svn: 104871
* further clarify alignment of globals, fix instcombineChris Lattner2010-04-281-17/+20
| | | | | | | to not increase the alignment of globals with an assigned alignment and section. llvm-svn: 102476
* use abstract accessors to CallInstGabor Greif2010-04-201-2/+2
| | | | llvm-svn: 101899
* Revert 101465, it broke internal OpenGL testing.Eric Christopher2010-04-161-78/+81
| | | | | | | Probably the best way to know that all getOperand() calls have been handled is to replace that API instead of updating. llvm-svn: 101579
* reapply r101434Gabor Greif2010-04-161-81/+78
| | | | | | | | | | | | | with a fix for self-hosting rotate CallInst operands, i.e. move callee to the back of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary llvm-svn: 101465
* back out r101423 and r101397, they break llvm-gcc self-host on darwin10Gabor Greif2010-04-161-78/+81
| | | | llvm-svn: 101434
OpenPOWER on IntegriCloud