1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
llvm-mirror/lib/Transforms
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
..
Coroutines [coroutines] Store an address of destroy OR cleanup part in the coroutine frame. 2016-10-08 00:22:50 +00:00
Hello Add auto-exporting of symbols from tools so that plugins work on Windows 2016-05-26 11:16:43 +00:00
InstCombine [InstCombine] fix foldSPFofSPF() to handle vector splats 2016-10-27 21:19:40 +00:00
Instrumentation Utility functions for appending to llvm.used/llvm.compiler.used. 2016-10-25 23:53:31 +00:00
IPO [ThinLTO] Rename HasSection to NoRename (NFC) 2016-10-28 02:24:59 +00:00
ObjCARC Use StringRef in ARCRuntimeEntryPoints APIs (NFC) 2016-10-05 01:15:04 +00:00
Scalar SpeculativeExecution: Allow speculating more inst types 2016-10-28 20:00:33 +00:00
Utils Don't leave unused divs/rems sitting around in BypassSlowDivision. 2016-10-28 21:43:54 +00:00
Vectorize [SLP] Fix for PR30626: Compiler crash inside SLP Vectorizer. 2016-10-27 12:02:28 +00:00
CMakeLists.txt [coroutines] Part 3 of N: Adding Boilerplate for Coroutine Passes 2016-07-28 21:04:31 +00:00
LLVMBuild.txt [coroutines] Part 3 of N: Adding Boilerplate for Coroutine Passes 2016-07-28 21:04:31 +00:00