llvm-project/llvm/lib
Roman Lebedev cc29600b90
[SCEV] SCEVExpander::isHighCostExpansionHelper(): cost-model plain UDiv
Summary:
If we don't believe this UDiv is actually a LShr in disguise, things are much worse.
First, we try to see if this UDiv actually originates from user code,
by looking for `S + 1`, and if found considering this UDiv to be free.
But otherwise, we always considered this UDiv to be high-cost.

However that is no longer the case with TTI-driven cost model:
our default budget is 4, which matches the default cost of UDiv,
so now we allow a single UDiv to not be counted as high-cost.

While that is the case, it is evident this is actually a regression
due to the fact that cost-modelling is incomplete - we did not account
for the `add`, `mul` costs yet. That is being addressed in D73728.

Cost-modelling for UDiv also seems pretty straight-forward:
subtract cost of the UDiv itself, and recurse into both the LHS and RHS.

Reviewers: reames, mkazantsev, wmi, sanjoy

Reviewed By: mkazantsev

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73722
2020-02-25 23:05:58 +03:00
..
Analysis [SCEV] SCEVExpander::isHighCostExpansionHelper(): cost-model plain UDiv 2020-02-25 23:05:58 +03:00
AsmParser Allow "callbr" to return non-void values 2020-02-24 18:29:06 -08:00
BinaryFormat [MachO] Add cpu(sub)type tests and improve error handling 2020-02-24 10:44:42 -08:00
Bitcode [NFC] Silence compiler warning [-Wmissing-braces]. 2020-02-18 10:37:12 -08:00
Bitstream Revert "Remove redundant "std::move"s in return statements" 2020-02-10 07:07:40 -08:00
CodeGen Support emitting .cfi_undefined in CodeGen 2020-02-25 14:00:01 -05:00
DWARFLinker [Debuginfo][NFC] Create common error handlers for DWARFContext. 2020-02-15 12:46:17 +03:00
DebugInfo Revert "[DWARFDebugLine] Avoid dumping prologue members we did not parse" 2020-02-25 17:58:50 +01:00
Demangle Use std::foo_t rather than std::foo in LLVM. 2020-02-11 15:12:51 -08:00
ExecutionEngine [ORC] Remove spammy debug print 2020-02-24 12:10:13 +01:00
Frontend [NFC] Revert unnecessary parts of b91c267380 2020-02-15 01:38:58 -06:00
FuzzMutate Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Fuzzer
IR Allow "callbr" to return non-void values 2020-02-24 18:29:06 -08:00
IRReader
LTO Improve comments after 8404aeb56a. 2020-02-18 14:25:21 -05:00
LineEditor Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Linker IR Linking: Support merging Warning+Max module metadata flags 2020-02-07 16:29:58 -08:00
MC Emit register names in cfi assembly directives 2020-02-25 14:00:01 -05:00
MCA Revert "Remove redundant "std::move"s in return statements" 2020-02-10 07:07:40 -08:00
Object [NFC] Fix typo in error message 2020-02-24 18:22:05 +01:00
ObjectYAML [yaml2obj] - Address post commit comments for D74764 2020-02-25 13:26:46 +03:00
Option Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Passes IR printing for single function with the new pass manager. 2020-02-23 15:28:57 -08:00
ProfileData Revert "Remove redundant "std::move"s in return statements" 2020-02-10 07:07:40 -08:00
Remarks Revert "Remove redundant "std::move"s in return statements" 2020-02-10 07:07:40 -08:00
Support Stop including sys/param.h from Unix.h 2020-02-25 15:35:04 +01:00
TableGen Fix assertion on `!eq(?, 0)` 2020-02-18 14:05:55 -08:00
Target [NFC][SCEV] Piping to pass TTI into SCEVExpander::isHighCostExpansionHelper() 2020-02-25 23:05:56 +03:00
Testing
TextAPI [llvm][TextAPI] add simulators to output 2020-02-11 10:37:37 -08:00
ToolDrivers [llvm] Replace SmallStr.str().str() with std::string conversion operator. 2020-01-29 21:16:46 -08:00
Transforms [NFC][SCEV] Piping to pass new SCEVCheapExpansionBudget option into SCEVExpander::isHighCostExpansionHelper() 2020-02-25 23:05:57 +03:00
WindowsManifest
XRay Use std::foo_t rather than std::foo in LLVM. 2020-02-11 15:12:51 -08:00
CMakeLists.txt [Dsymutil][Debuginfo][NFC] Reland: Refactor dsymutil to separate DWARF optimizing part. #2. 2020-01-08 14:15:31 +03:00
LLVMBuild.txt [Dsymutil][Debuginfo][NFC] Reland: Refactor dsymutil to separate DWARF optimizing part. #2. 2020-01-08 14:15:31 +03:00