summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r136253, r136263, r136269, r136313, r136325, r136326, r136329, r136338,Bill Wendling2011-07-301-5/+3
| | | | | | | r136339, r136341, r136369, r136387, r136392, r136396, r136429, r136430, r136444, r136445, r136446, r136253 pending review. llvm-svn: 136556
* Merge the contents from exception-handling-rewrite to the mainline.Bill Wendling2011-07-271-3/+5
| | | | | | This adds the new instructions 'landingpad' and 'resume'. llvm-svn: 136253
* Convert TargetData::getIndexedOffset to use ArrayRef.Jay Foad2011-07-191-2/+1
| | | | llvm-svn: 135478
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-34/+34
| | | | llvm-svn: 135375
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-151-4/+4
| | | | llvm-svn: 135265
* Change Intrinsic::getDeclaration and friends to take an ArrayRef.Benjamin Kramer2011-07-141-1/+1
| | | | llvm-svn: 135154
* Second attempt at de-constifying LLVM Types in FunctionType::get(),Jay Foad2011-07-121-5/+5
| | | | | | StructType::get() and TargetData::getIntPtrType(). llvm-svn: 134982
* Revert r134893 and r134888 (and related patches in other trees). It was causingBill Wendling2011-07-121-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* De-constify Types in FunctionType::get().Jay Foad2011-07-111-5/+5
| | | | llvm-svn: 134888
* Generalize @llvm.ctlz, @llvm.cttz, and @llvm.ctpop to work on vectors of ↵Owen Anderson2011-07-011-2/+6
| | | | | | integers, and fix the one optimization pass that I'm aware of that needs updating for this. At least one current target, ARM NEON, can implement these operations on vectors directly. llvm-svn: 134265
* Revamp the "ConstantStruct::get" methods. Previously, these were scatteredChris Lattner2011-06-201-6/+11
| | | | | | | | | | | | | | | all over the place in different styles and variants. Standardize on two preferred entrypoints: one that takes a StructType and ArrayRef, and one that takes StructType and varargs. In cases where there isn't a struct type convenient, we now add a ConstantStruct::getAnon method (whose name will make more sense after a few more patches land). It would be "really really nice" if the ConstantStruct::get and ConstantVector::get methods didn't make temporary std::vectors. llvm-svn: 133412
* Final step of instcombine debuginfo; switch a couple more places over to ↵Eli Friedman2011-05-271-0/+1
| | | | | | InsertNewInstWith, and use setDebugLoc for the cases which can't be easily handled by the automated mechanisms. llvm-svn: 132167
* 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
OpenPOWER on IntegriCloud