1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/lib/Transforms/Utils
Dan Gohman 39c48b9d3e Add an @llvm.sideeffect intrinsic
This patch implements Chandler's idea [0] for supporting languages that
require support for infinite loops with side effects, such as Rust, providing
part of a solution to bug 965 [1].

Specifically, it adds an `llvm.sideeffect()` intrinsic, which has no actual
effect, but which appears to optimization passes to have obscure side effects,
such that they don't optimize away loops containing it. It also teaches
several optimization passes to ignore this intrinsic, so that it doesn't
significantly impact optimization in most cases.

As discussed on llvm-dev [2], this patch is the first of two major parts.
The second part, to change LLVM's semantics to have defined behavior
on infinite loops by default, with a function attribute for opting into
potential-undefined-behavior, will be implemented and posted for review in
a separate patch.

[0] http://lists.llvm.org/pipermail/llvm-dev/2015-July/088103.html
[1] https://bugs.llvm.org/show_bug.cgi?id=965
[2] http://lists.llvm.org/pipermail/llvm-dev/2017-October/118632.html

Differential Revision: https://reviews.llvm.org/D38336

llvm-svn: 317729
2017-11-08 21:59:51 +00:00
..
AddDiscriminators.cpp [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-17 21:27:42 +00:00
ASanStackFrameLayout.cpp
BasicBlockUtils.cpp loop-rotate: eliminate duplicate debug intrinsics after splicing. 2017-11-01 20:43:30 +00:00
BreakCriticalEdges.cpp [Dominators] Teach LoopUnswitch to use the incremental API 2017-08-17 16:45:35 +00:00
BuildLibCalls.cpp
BypassSlowDivision.cpp [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-17 21:27:42 +00:00
CloneFunction.cpp Use a BumpPtrAllocator for Loop objects 2017-09-28 02:45:42 +00:00
CloneModule.cpp [Cloning] Move distinct GlobalVariable debug info metadata in CloneModule 2017-08-03 09:23:03 +00:00
CMakeLists.txt Recommit r310869, "[InstSimplify][InstCombine] Modify the interface of decomposeBitTestICmp and use it in the InstSimplify" 2017-08-14 21:39:51 +00:00
CodeExtractor.cpp [CodeExtractor] Fix iterator invalidation in findOrCreateBlockForHoisting. 2017-11-01 09:48:12 +00:00
CtorUtils.cpp
DemoteRegToStack.cpp
EscapeEnumerator.cpp
Evaluator.cpp Add an @llvm.sideeffect intrinsic 2017-11-08 21:59:51 +00:00
FlattenCFG.cpp [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-26 00:55:39 +00:00
FunctionComparator.cpp [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-11 21:41:43 +00:00
FunctionImportUtils.cpp [LTO][ThinLTO] Use the linker resolutions to mark global values as dso_local. 2017-11-04 17:04:39 +00:00
GlobalStatus.cpp
ImportedFunctionsInliningStatistics.cpp
InlineFunction.cpp [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-17 21:27:42 +00:00
InstructionNamer.cpp
IntegerDivision.cpp
LCSSA.cpp
LibCallsShrinkWrap.cpp
LLVMBuild.txt
Local.cpp InstCombine: salvage the debug info of DCE'ed add instructions. 2017-11-06 22:49:39 +00:00
LoopSimplify.cpp Use a BumpPtrAllocator for Loop objects 2017-09-28 02:45:42 +00:00
LoopUnroll.cpp loop-unroll: teach remapInstruction to update dbg.value intrinsics. 2017-11-01 23:12:35 +00:00
LoopUnrollPeel.cpp [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-27 01:09:08 +00:00
LoopUnrollRuntime.cpp [LoopUnroll] Clean up remarks for unroll remainder 2017-10-31 10:47:46 +00:00
LoopUtils.cpp [IR] redefine 'UnsafeAlgebra' / 'reassoc' fast-math-flags and add 'trans' fast-math-flag 2017-11-06 16:27:15 +00:00
LoopVersioning.cpp
LowerInvoke.cpp
LowerMemIntrinsics.cpp
LowerSwitch.cpp [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-21 00:57:46 +00:00
Mem2Reg.cpp [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-26 00:55:39 +00:00
MetaRenamer.cpp [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-27 01:09:08 +00:00
ModuleUtils.cpp ModuleUtils: Stop using comdat members to generate unique module ids. 2017-10-05 21:54:53 +00:00
NameAnonGlobals.cpp
OrderedInstructions.cpp
PredicateInfo.cpp [Transforms] Revert r315516 changes in PredicateInfo to fix Windows build bots (NFC). 2017-10-11 21:56:44 +00:00
PromoteMemoryToRegister.cpp [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-21 00:57:46 +00:00
SanitizerStats.cpp
SimplifyCFG.cpp [SimplifyCFG] When merging conditional stores, don't count the store we're merging against the PHINodeFoldingThreshold 2017-11-03 21:08:13 +00:00
SimplifyIndVar.cpp Revert 317016 and 317048 2017-11-01 19:49:20 +00:00
SimplifyInstructions.cpp Rename OptimizationDiagnosticInfo.* to OptimizationRemarkEmitter.* 2017-10-09 23:19:02 +00:00
SimplifyLibCalls.cpp [IR] redefine 'UnsafeAlgebra' / 'reassoc' fast-math-flags and add 'trans' fast-math-flag 2017-11-06 16:27:15 +00:00
SplitModule.cpp Add llvm::for_each as a range-based extensions to <algorithm> and make use of it in some cases where it is a more clear alternative to std::for_each. 2017-11-03 20:01:25 +00:00
SSAUpdater.cpp [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-11 21:41:43 +00:00
StripGCRelocates.cpp
StripNonLineTableDebugInfo.cpp
SymbolRewriter.cpp [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-11 21:41:43 +00:00
UnifyFunctionExitNodes.cpp
Utils.cpp
ValueMapper.cpp [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-26 00:55:39 +00:00
VNCoercion.cpp