aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/IntrinsicLowering.cpp
AgeCommit message (Collapse)AuthorFilesLines
2015-12-14getParent() ^ 3 == getModule() ; NFCISanjay Patel1-2/+2
llvm-svn: 255511
2015-12-01Introduce new @llvm.get.dynamic.area.offset.i{32, 64} intrinsics.Yury Gribov1-0/+7
The @llvm.get.dynamic.area.offset.* intrinsic family is used to get the offset from native stack pointer to the address of the most recent dynamic alloca on the caller's stack. These intrinsics are intendend for use in combination with @llvm.stacksave and @llvm.restore to get a pointer to the most recent dynamic alloca. This is useful, for example, for AddressSanitizer's stack unpoisoning routines. Patch by Max Ostapenko. Differential Revision: http://reviews.llvm.org/D14983 llvm-svn: 254404
2015-10-09CodeGen: Remove more ilist iterator implicit conversions, NFCDuncan P. N. Exon Smith1-6/+6
llvm-svn: 249879
2015-10-09CodeGen: Use range-based for in IntrinsicLowering::AddPrototypes, NFCDuncan P. N. Exon Smith1-21/+21
This happens to avoid a host of implicit ilist iterator conversions. llvm-svn: 249877
2014-08-30[PATCH][Interpreter] Add missing FP intrinsic lowering.Josh Klontz1-0/+16
Summary: This extends the work done in [1], adding missing intrinsic lowering for floor, trunc, round and copysign. [1] http://comments.gmane.org/gmane.comp.compilers.llvm.cvs/199372 Test Plan: Extended `test/ExecutionEngine/Interpreter/intrinsics.ll` to test the additional missing intrinsics. All tests pass. Reviewers: dexonsmith Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5120 llvm-svn: 216827
2014-08-08Add missing Interpreter intrinsic lowering for sin, cos and ceilJosh Klontz1-0/+12
llvm-svn: 215209
2014-07-25Add @llvm.assume, lowering, and some basic propertiesHal Finkel1-2/+3
This is the first commit in a series that add an @llvm.assume intrinsic which can be used to provide the optimizer with a condition it may assume to be true (when the control flow would hit the intrinsic call). Some basic properties are added here: - llvm.invariant(true) is dead. - llvm.invariant(false) is unreachable (this directly corresponds to the documented behavior of MSVC's __assume(0)), so is llvm.invariant(undef). The intrinsic is tagged as writing arbitrarily, in order to maintain control dependencies. BasicAA has been updated, however, to return NoModRef for any particular location-based query so that we don't unnecessarily block code motion. llvm-svn: 213973
2014-04-14[C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper1-3/+3
instead of comparing to nullptr. llvm-svn: 206142
2014-03-04[Modules] Move CallSite into the IR library where it belogs. It isChandler Carruth1-1/+1
abstracting between a CallInst and an InvokeInst, both of which are IR concepts. llvm-svn: 202816
2014-02-18Rename some member variables from TD to DL.Rafael Espindola1-6/+6
TargetData was renamed DataLayout back in r165242. llvm-svn: 201581
2013-11-10Use type form of getIntPtrType.Matt Arsenault1-2/+3
This should be inconsequential and is work towards removing the default address space arguments. llvm-svn: 194347
2013-05-21Drop @llvm.annotation and @llvm.ptr.annotation intrinsics during codegen.Justin Holewinski1-0/+6
The intrinsic calls are dropped, but the annotated value is propagated. Fixes PR 15253 Original patch by Zeng Bin! llvm-svn: 182387
2013-02-08Revert "Add LLVMContext::emitWarning methods and use them. ↵Bob Wilson1-22/+14
<rdar://problem/12867368>" This reverts r171041. This was a nice idea that didn't work out well. Clang warnings need to be associated with warning groups so that they can be selectively disabled, promoted to errors, etc. This simplistic patch didn't allow for that. Enhancing it to provide some way for the backend to specify a front-end warning type seems like overkill for the few uses of this, at least for now. llvm-svn: 174748
2013-01-02Move all of the header files which are involved in modelling the LLVM IRChandler Carruth1-6/+6
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
2012-12-24Add LLVMContext::emitWarning methods and use them. <rdar://problem/12867368>Bob Wilson1-14/+22
When the backend is used from clang, it should produce proper diagnostics instead of just printing messages to errs(). Other clients may also want to register their own error handlers with the LLVMContext, and the same handler should work for warnings in the same way as the existing emitError methods. llvm-svn: 171041
2012-12-03Use the new script to sort the includes of every file under lib.Chandler Carruth1-3/+3
Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
2012-11-01Revert the series of commits starting with r166578 which introduced theChandler Carruth1-6/+6
getIntPtrType support for multiple address spaces via a pointer type, and also introduced a crasher bug in the constant folder reported in PR14233. These commits also contained several problems that should really be addressed before they are re-committed. I have avoided reverting various cleanups to the DataLayout APIs that are reasonable to have moving forward in order to reduce the amount of churn, and minimize the number of commits that were reverted. I've also manually updated merge conflicts and manually arranged for the getIntPtrType function to stay in DataLayout and to be defined in a plausible way after this revert. Thanks to Duncan for working through this exact strategy with me, and Nick Lewycky for tracking down the really annoying crasher this triggered. (Test case to follow in its own commit.) After discussing with Duncan extensively, and based on a note from Micah, I'm going to continue to back out some more of the more problematic patches in this series in order to ensure we go into the LLVM 3.2 branch with a reasonable story here. I'll send a note to llvmdev explaining what's going on and why. Summary of reverted revisions: r166634: Fix a compiler warning with an unused variable. r166607: Add some cleanup to the DataLayout changes requested by Chandler. r166596: Revert "Back out r166591, not sure why this made it through since I cancelled the command. Bleh, sorry about this! r166591: Delete a directory that wasn't supposed to be checked in yet. r166578: Add in support for getIntPtrType to get the pointer type based on the address space. llvm-svn: 167221
2012-10-29Remove a wrapper around getIntPtrType added to GVN by Hal in commit 166624 (theDuncan Sands1-3/+3
wrapper returns a vector of integers when passed a vector of pointers) by having getIntPtrType itself return a vector of integers in this case. Outside of this wrapper, I didn't find anywhere in the codebase that was relying on the old behaviour for vectors of pointers, so give this a whirl through the buildbots. llvm-svn: 166939
2012-10-24Add in support for getIntPtrType to get the pointer type based on the ↵Micah Villmow1-6/+6
address space. This checkin also adds in some tests that utilize these paths and updates some of the clients. llvm-svn: 166578
2012-10-08Move TargetData to DataLayout.Micah Villmow1-1/+1
llvm-svn: 165402
2012-06-29Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.hChandler Carruth1-3/+3
This was always part of the VMCore library out of necessity -- it deals entirely in the IR. The .cpp file in fact was already part of the VMCore library. This is just a mechanical move. I've tried to go through and re-apply the coding standard's preferred header sort, but at 40-ish files, I may have gotten some wrong. Please let me know if so. I'll be committing the corresponding updates to Clang and Polly, and Duncan has DragonEgg. Thanks to Bill and Eric for giving the green light for this bit of cleanup. llvm-svn: 159421
2012-01-31Remove the now-dead llvm.eh.exception and llvm.eh.selector intrinsics.Bill Wendling1-5/+0
llvm-svn: 149331
2011-07-18land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner1-5/+5
llvm-svn: 135375
2011-07-15Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad1-1/+1
llvm-svn: 135265
2011-07-14Change Intrinsic::getDeclaration and friends to take an ArrayRef.Benjamin Kramer1-2/+1
llvm-svn: 135154
2011-07-12Second attempt at de-constifying LLVM Types in FunctionType::get(),Jay Foad1-4/+4
StructType::get() and TargetData::getIntPtrType(). llvm-svn: 134982
2011-07-12Revert r134893 and r134888 (and related patches in other trees). It was causingBill Wendling1-4/+4
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-11De-constify Types in FunctionType::get().Jay Foad1-4/+4
llvm-svn: 134888
2011-07-06Introduce "expect" intrinsic instructions.Jakub Staszak1-0/+7
llvm-svn: 134516
2011-01-08Recognize inline asm 'rev /bin/bash, ' as a bswap intrinsic call.Evan Cheng1-0/+24
llvm-svn: 123048
2010-09-24Get rid of pop_macro warnings on MSVC.Michael J. Spencer1-3/+5
llvm-svn: 114750
2010-07-22undo 80 column trespassing I causedGabor Greif1-1/+2
llvm-svn: 109092
2010-06-30use CallSite::arg_end instead of CallInst::op_endGabor Greif1-1/+1
llvm-svn: 107276
2010-06-25use ArgOperand API and CallSite to access arguments of CallInstGabor Greif1-23/+26
llvm-svn: 106833
2010-05-11Fixes for Microsoft Visual Studio 2010, from Steven Watanabe!Douglas Gregor1-0/+6
llvm-svn: 103457
2010-04-16Revert 101465, it broke internal OpenGL testing.Eric Christopher1-23/+23
Probably the best way to know that all getOperand() calls have been handled is to replace that API instead of updating. llvm-svn: 101579
2010-04-16reapply r101434Gabor Greif1-23/+23
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
2010-04-16back out r101423 and r101397, they break llvm-gcc self-host on darwin10Gabor Greif1-23/+23
llvm-svn: 101434
2010-04-15reapply r101364, which has been backed out in r101368Gabor Greif1-23/+23
with a fix 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: 101397
2010-04-15back out r101364, as it trips the linux nightlybot on some clang C++ testsGabor Greif1-23/+23
llvm-svn: 101368
2010-04-15rotate CallInst operands, i.e. move callee to the backGabor Greif1-23/+23
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: 101364
2010-04-15Add const qualifiers to CodeGen's use of LLVM IR constructs.Dan Gohman1-1/+1
llvm-svn: 101334
2010-04-07rename llvm::llvm_report_error -> llvm::report_fatal_errorChris Lattner1-2/+2
llvm-svn: 100709
2010-02-15Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands1-2/+2
isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! llvm-svn: 96223
2010-01-05Avoid going through the LLVMContext for type equality where it's safe to ↵Benjamin Kramer1-3/+3
dereference the type pointer. llvm-svn: 92726
2010-01-05Delete renaming use of dead dbg intrinsics.Devang Patel1-4/+0
Intrinsic::dbg_stoppoint Intrinsic::dbg_region_start Intrinsic::dbg_region_end Intrinsic::dbg_func_start llvm-svn: 92672
2009-11-10Codegen support for the llvm.invariant/lifetime.start/end intrinsics:Duncan Sands1-0/+9
just throw them away. llvm-svn: 86678
2009-10-14I don't see any point in having both eh.selector.i32 and eh.selector.i64,Duncan Sands1-4/+2
so get rid of eh.selector.i64 and rename eh.selector.i32 to eh.selector. Likewise for eh.typeid.for. This aligns us with gcc, which always uses a 32 bit value for the selector on all platforms. My understanding is that the register allocator used to assert if the selector intrinsic size didn't match the pointer size, and this was the reason for introducing the two variants. However my testing shows that this is no longer the case (I fixed some bugs in selector lowering yesterday, and some more today in the fastisel path; these might have caused the original problems). llvm-svn: 84106
2009-10-06Introduce and use convenience methods for getting pointer typesDuncan Sands1-8/+8
where the element is of a basic builtin type. For example, to get an i8* use getInt8PtrTy. llvm-svn: 83379
2009-08-23Change Pass::print to take a raw ostream instead of std::ostream,Chris Lattner1-7/+8
update all code that this affects. llvm-svn: 79830