1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
llvm-mirror/lib/Transforms/Utils
Justin Lebar 188600d04d Don't leave unused divs/rems sitting around in BypassSlowDivision.
Summary:
This "pass" eagerly creates div and rem instructions even when only one
is needed -- it relies on a later pass (machine DCE?) to clean them up.

This is problematic not just from a cleanliness perspective (this pass
is running during CodeGenPrepare, so should leave the IR in a better
state), but it also creates a problem for instruction selection.  If we
always have a div+rem, isel will always select a divrem instruction (if
possible), even when a single div or rem would do.

Specifically, in NVPTX, we want to compute rem from the output of div,
if available.  But if a div is not available, we want to leave the rem
alone.  This transformation is overeager if div is always available.

Because this code runs as part of CodeGenPrepare, it's nontrivial to
write a test for this change.  But this will effectively be tested by
a later patch which adds the aforementioned change to NVPTX isel.

Reviewers: tra

Subscribers: llvm-commits

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

llvm-svn: 285460
2016-10-28 21:43:54 +00:00
..
AddDiscriminators.cpp Introduce updateDiscriminator interface to DILocation to make it cleaner assigning discriminators. 2016-10-26 15:48:45 +00:00
ASanStackFrameLayout.cpp [asan] Replace std::to_string with llvm::to_string 2016-10-19 00:16:56 +00:00
BasicBlockUtils.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
BreakCriticalEdges.cpp [PM] Port BreakCriticalEdges to the new PM. 2016-07-22 18:04:25 +00:00
BuildLibCalls.cpp Recommitting r275284: add support to inline __builtin_mempcpy 2016-07-29 18:23:18 +00:00
BypassSlowDivision.cpp Don't leave unused divs/rems sitting around in BypassSlowDivision. 2016-10-28 21:43:54 +00:00
CloneFunction.cpp [CloneFunction] Don't remove unrelated nodes from the CGSSC 2016-08-19 16:37:40 +00:00
CloneModule.cpp Cloning: Also clone global variable attached metadata. 2016-10-26 02:57:33 +00:00
CMakeLists.txt Add -strip-nonlinetable-debuginfo capability 2016-10-25 18:44:13 +00:00
CmpInstAnalysis.cpp move decomposeBitTestICmp() to Transforms/Utils; NFC 2016-07-20 17:18:45 +00:00
CodeExtractor.cpp CodeExtractor : Add ability to preserve profile data. 2016-08-02 02:15:45 +00:00
CtorUtils.cpp [CtorUtils] Modernize. No functional changes intended. 2016-10-22 01:21:24 +00:00
DemoteRegToStack.cpp
Evaluator.cpp Use the range variant of find instead of unpacking begin/end 2016-08-11 22:21:41 +00:00
FlattenCFG.cpp [FlattenCFG] Simplify + remove unused variable. NFCI. 2016-08-05 20:53:35 +00:00
FunctionImportUtils.cpp IR: Introduce local_unnamed_addr attribute. 2016-06-14 21:01:22 +00:00
GlobalStatus.cpp Merge two if conditions into one. NFCI. 2016-10-24 19:41:47 +00:00
ImportedFunctionsInliningStatistics.cpp Imported statistics types changes 2016-08-02 22:18:47 +00:00
InlineFunction.cpp Inliner: Don't mark swifterror allocas with lifetime markers 2016-09-09 22:40:27 +00:00
InstructionNamer.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
IntegerDivision.cpp TransformUtils: Avoid getNodePtrUnchecked() in integer division, NFC 2016-02-21 20:14:29 +00:00
LCSSA.cpp [LCSSA] Perform LCSSA verification only for the current loop nest. 2016-10-28 12:57:20 +00:00
LibCallsShrinkWrap.cpp Check the number of Args in LibCallsShrinkWrap. 2016-10-24 16:50:12 +00:00
LLVMBuild.txt
Local.cpp [DebugInfo] Add comments to phi dbg.value tracking code, NFC 2016-09-27 18:45:31 +00:00
LoopSimplify.cpp [LCSSA] Implement linear algorithm for the isRecursivelyLCSSAForm 2016-10-11 13:37:22 +00:00
LoopUnroll.cpp [LoopUnroll] Keep the loop test only on the first iteration of max-or-zero loops 2016-10-21 11:08:48 +00:00
LoopUnrollRuntime.cpp Revert "[LoopUnroll] Properly update loop-info when cloning prologues and epilogues." 2016-09-08 03:51:30 +00:00
LoopUtils.cpp [LCSSA] Perform LCSSA verification only for the current loop nest. 2016-10-28 12:57:20 +00:00
LoopVersioning.cpp Rename LoopAccessAnalysis to LoopAccessLegacyAnalysis /NFC 2016-07-08 20:55:26 +00:00
LowerInvoke.cpp [PM] Port LowerInvoke to the new pass manager 2016-08-12 17:28:27 +00:00
LowerSwitch.cpp Use the range variant of remove_if instead of unpacking begin/end 2016-08-12 04:32:37 +00:00
Mem2Reg.cpp Consistently use FunctionAnalysisManager 2016-08-09 00:28:15 +00:00
MemorySSA.cpp [MemorySSA] Add const to getClobberingMemoryAccess. 2016-10-28 19:22:46 +00:00
MetaRenamer.cpp
ModuleUtils.cpp Utility functions for appending to llvm.used/llvm.compiler.used. 2016-10-25 23:53:31 +00:00
NameAnonGlobals.cpp Use StringRef in Pass/PassManager APIs (NFC) 2016-10-01 02:56:57 +00:00
PromoteMemoryToRegister.cpp Reapplying r281895 (and follow-up r281964) after fixing pr30468. 2016-09-22 14:13:25 +00:00
SanitizerStats.cpp Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; other minor fixes. 2016-01-26 18:48:36 +00:00
SimplifyCFG.cpp Ignore debug info when making optimization decisions in SimplifyCFG. 2016-10-17 19:28:44 +00:00
SimplifyIndVar.cpp [IndVars] Remove -liv-reduce 2016-06-05 18:01:12 +00:00
SimplifyInstructions.cpp Explicitly require DominatorTreeAnalysis pass for instsimplify pass. 2016-09-06 22:17:16 +00:00
SimplifyLibCalls.cpp Enable simplify libcalls for ARM PCS 2016-09-13 12:10:14 +00:00
SplitModule.cpp Move instances of std::function. 2016-06-12 16:13:55 +00:00
SSAUpdater.cpp Use the range variant of find instead of unpacking begin/end 2016-08-11 22:21:41 +00:00
StripGCRelocates.cpp [StripGCRelocates] New pass to remove gc.relocates added by RS4GC 2016-10-21 18:43:16 +00:00
StripNonLineTableDebugInfo.cpp Add -strip-nonlinetable-debuginfo capability 2016-10-25 18:44:13 +00:00
SymbolRewriter.cpp [PM] Port SymbolRewriter to the new PM 2016-07-25 20:52:00 +00:00
UnifyFunctionExitNodes.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
Utils.cpp Add -strip-nonlinetable-debuginfo capability 2016-10-25 18:44:13 +00:00
ValueMapper.cpp Do a sweep over move ctors and remove those that are identical to the default. 2016-10-20 12:20:28 +00:00