llvm-project/llvm/test/Transforms/LICM
Dan Gohman 2c74fe977d 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
..
2003-02-26-LoopExitNotDominated.ll
2003-02-27-NestedLoopExitBlocks.ll
2003-02-27-PreheaderExitNodeUpdate.ll
2003-02-27-PreheaderProblem.ll
2003-02-27-StoreSinkPHIs.ll
2003-02-28-PromoteDifferentType.ll
2003-05-02-LoadHoist.ll
2003-12-11-SinkingToPHI.ll
2004-09-14-AliasAnalysisInvalidate.ll
2004-11-17-UndefIndexCrash.ll
2006-09-12-DeadUserOfSunkInstr.ll
2007-05-22-VolatileSink.ll
2007-07-30-AliasSet.ll
2007-09-17-PromoteValue.ll
2007-09-24-PromoteNullValue.ll
2007-10-01-PromoteSafeValue.ll
2008-05-20-AliasSetVAArg.ll
2008-07-22-LoadGlobalConstant.ll
2009-12-10-LICM-Indbr-Crash.ll
2011-04-06-HoistMissedASTUpdate.ll
2011-04-06-PromoteResultOfPromotion.ll [Verifier] Add verification for TBAA metadata 2016-12-11 20:07:15 +00:00
2011-04-09-RAUW-AST.ll
2011-07-06-Alignment.ll
2014-09-10-doFinalizationAssert.ll
AliasSetMemSet.ll
PR19798.ll
PR21582.ll
PR24013.ll
Preserve-LCSSA.ll
alias-set-tracker-loss.ll
argmemonly-call.ll [LICM] Report successful hoist/sink/promotion 2017-01-11 04:39:35 +00:00
assume.ll [LICM] Report successful hoist/sink/promotion 2017-01-11 04:39:35 +00:00
atomics.ll [LICM] Make store promotion work in the face of unordered atomics 2017-02-14 01:38:31 +00:00
basictest.ll [LICM] Report successful hoist/sink/promotion 2017-01-11 04:39:35 +00:00
bisect-state.ll [LICM] Work around LICM needs to maintain state across loops. 2016-12-23 13:12:50 +00:00
constexpr.ll [PM] Teach the LoopPassManager to automatically canonicalize loops by 2017-01-17 19:18:12 +00:00
crash.ll [LICM] Report successful hoist/sink/promotion 2017-01-11 04:39:35 +00:00
debug-value.ll Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
dropped-tbaa.ll [AliasSetTracker] Don't drop AA MD so eagerly 2017-06-29 19:13:11 +00:00
extra-copies.ll [LICM] Report successful hoist/sink/promotion 2017-01-11 04:39:35 +00:00
funclet.ll [LICM] Report successful hoist/sink/promotion 2017-01-11 04:39:35 +00:00
hoist-bitcast-load.ll [PM] Teach the loop PM to run LoopSimplify prior to the loop pipeline. 2017-01-21 03:48:51 +00:00
hoist-deref-load.ll [PM] Teach the loop PM to run LoopSimplify prior to the loop pipeline. 2017-01-21 03:48:51 +00:00
hoist-fast-fdiv.ll [LICM] Hoist fp division from the loops and replace by a reciprocal 2017-04-11 02:22:54 +00:00
hoist-invariant-load.ll
hoist-nounwind.ll [PM] Teach the LoopPassManager to automatically canonicalize loops by 2017-01-17 19:18:12 +00:00
hoist-round.ll Mark @llvm.powi.* as safe to speculatively execute. 2017-01-25 09:32:30 +00:00
hoisting.ll [LICM] Hoist loads that are dominated by invariant.start intrinsic, and are invariant in the loop. 2017-02-02 13:22:03 +00:00
int_sideeffect.ll Add an @llvm.sideeffect intrinsic 2017-11-08 21:59:51 +00:00
lcssa-ssa-promoter.ll [LICM] Report successful hoist/sink/promotion 2017-01-11 04:39:35 +00:00
loopsink.ll Add test case for LoopSink pass 2017-10-20 06:40:48 +00:00
no-preheader-test.ll [LICM] Report successful hoist/sink/promotion 2017-01-11 04:39:35 +00:00
opt-remarks-conditional-load.ll [LICM] Report failing to hoist conditionally-executed loads 2017-01-11 04:39:49 +00:00
opt-remarks-intervening-store.ll [LICM] Report failing to hoist a load with an invariant address 2017-01-11 04:39:45 +00:00
opt-remarks.ll Correct a typo, s/hosting/hoisting/ 2017-02-14 16:41:10 +00:00
pr23608.ll
pr26843.ll
pr27262.ll
pr32129.ll Use a WeakVH for UnknownInstructions in AliasSetTracker 2017-03-11 01:15:48 +00:00
preheader-safe.ll Revert "Compute safety information in a much finer granularity." 2017-04-24 18:25:07 +00:00
promote-order.ll [LICM] Report successful hoist/sink/promotion 2017-01-11 04:39:35 +00:00
promote-tls.ll [LICM] Report successful hoist/sink/promotion 2017-01-11 04:39:35 +00:00
scalar-promote-memmodel.ll [LICM] Report successful hoist/sink/promotion 2017-01-11 04:39:35 +00:00
scalar-promote-unwind.ll Improve what can be promoted in LICM. 2017-01-19 19:31:40 +00:00
scalar-promote.ll [LICM] Make store promotion work in the face of unordered atomics 2017-02-14 01:38:31 +00:00
sink.ll [PM] Port LoopSink to the new pass manager. 2017-01-20 08:42:19 +00:00
sinking.ll [LICM] sink through non-trivially replicable PHI 2017-11-03 16:24:53 +00:00
speculate.ll [LICM] Report successful hoist/sink/promotion 2017-01-11 04:39:35 +00:00
strlen.ll Add argmononly attribute to strlen and wcslen, i.e. they only read memory (string) passed to them. 2017-06-18 03:10:26 +00:00
unrolled-deeply-nested.ll [LICM] When we are recomputing the alias sets for a subloop, we cannot 2017-01-27 10:27:32 +00:00
update-scev.ll
volatile-alias.ll [LICM] Report successful hoist/sink/promotion 2017-01-11 04:39:35 +00:00