1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00
llvm-mirror/lib/IR
Nikita Popov 54bcf692a3 [ConstantRange] Add sdiv() support
The implementation is conceptually simple: We separate the LHS and
RHS into positive and negative components and then also compute the
positive and negative components of the result, taking into account
that e.g. only pos/pos and neg/neg will give a positive result.

However, there's one significant complication: SignedMin / -1 is UB
for sdiv, and we can't just ignore it, because the APInt result of
SignedMin would break the sign segregation. Instead we drop SignedMin
or -1 from the corresponding ranges, taking into account some edge
cases with wrapped ranges.

Because of the sign segregation, the implementation ends up being
nearly fully precise even for wrapped ranges (the remaining
imprecision is due to ranges that are both signed and unsigned
wrapping and are divided by a trivial divisor like 1). This means
that the testing cannot just check the signed envelope as we
usually do. Instead we collect all possible results in a bitvector
and construct a better sign wrapped range (than the full envelope).

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

llvm-svn: 362430
2019-06-03 18:19:54 +00:00
..
AbstractCallSite.cpp
AsmWriter.cpp [SVE][IR] Scalable Vector IR Type 2019-05-29 12:22:54 +00:00
AttributeImpl.h Reapply: IR: add optional type to 'byval' function parameters 2019-05-30 18:48:23 +00:00
Attributes.cpp Reapply: IR: add optional type to 'byval' function parameters 2019-05-30 18:48:23 +00:00
AttributesCompatFunc.td
AutoUpgrade.cpp [IR] Disallow llvm.global_ctors and llvm.global_dtors of the 2-field form in textual format 2019-05-15 02:35:32 +00:00
BasicBlock.cpp [NFC] BasicBlock: generalize replaceSuccessorsPhiUsesWith(), take Old bb 2019-05-05 18:59:45 +00:00
CMakeLists.txt
Comdat.cpp
ConstantFold.cpp Add FNeg IR constant folding support 2019-05-05 16:07:09 +00:00
ConstantFold.h Add FNeg IR constant folding support 2019-05-05 16:07:09 +00:00
ConstantRange.cpp [ConstantRange] Add sdiv() support 2019-06-03 18:19:54 +00:00
Constants.cpp [Constants] Simplify type checking switch in ConstantExpr::get. 2019-05-05 17:19:16 +00:00
ConstantsContext.h
Core.cpp [LLVM-C] Deprecate the LLVMValueRef-returning metadata creation functions 2019-04-24 17:05:08 +00:00
DataLayout.cpp
DebugInfo.cpp [DebugInfo] Delete TypedDINodeRef 2019-05-07 02:06:37 +00:00
DebugInfoMetadata.cpp [DebugInfoMetadata] Refactor DIExpression::prepend constants (NFC) 2019-05-20 10:35:57 +00:00
DebugLoc.cpp
DiagnosticHandler.cpp
DiagnosticInfo.cpp [Remarks][NFC] Move the serialization to lib/Remarks 2019-05-30 21:45:59 +00:00
DiagnosticPrinter.cpp
DIBuilder.cpp [DebugInfo] Delete TypedDINodeRef 2019-05-07 02:06:37 +00:00
Dominators.cpp
Function.cpp Reapply: IR: add optional type to 'byval' function parameters 2019-05-30 18:48:23 +00:00
Globals.cpp Add IR support, ELF section and user documentation for partitioning feature. 2019-05-29 03:29:01 +00:00
GVMaterializer.cpp
InlineAsm.cpp
Instruction.cpp [NFC] Instruction: introduce replaceSuccessorWith() function, use it 2019-05-05 18:59:22 +00:00
Instructions.cpp [NFC] SwitchInst: Introduce wrapper for prof branch_weights handling 2019-05-24 04:34:23 +00:00
IntrinsicInst.cpp [IR] Add SaturatingInst and BinaryOpIntrinsic classes 2019-05-28 18:08:06 +00:00
IRBuilder.cpp Match types of accumulator and result for llvm.experimental.vector.reduce.fadd/fmul 2019-05-20 09:54:06 +00:00
IRPrintingPasses.cpp
LegacyPassManager.cpp ftime-trace: Trace the name of the currently active pass as well. 2019-04-20 23:22:45 +00:00
LLVMBuild.txt [Remarks] Add string deduplication using a string table 2019-04-24 00:06:24 +00:00
LLVMContext.cpp
LLVMContextImpl.cpp
LLVMContextImpl.h [SVE][IR] Scalable Vector IR Type 2019-05-29 12:22:54 +00:00
Mangler.cpp
MDBuilder.cpp Use llvm::stable_sort 2019-04-23 14:51:27 +00:00
Metadata.cpp Use llvm::stable_sort 2019-04-23 14:51:27 +00:00
MetadataImpl.h
Module.cpp
ModuleSummaryIndex.cpp [ThinLTO] Auto-hide prevailing linkonce_odr only when all copies eligible 2019-05-10 20:08:24 +00:00
Operator.cpp
OptBisect.cpp
Pass.cpp [IR] Refactor attribute methods in Function class (NFC) 2019-04-04 22:40:06 +00:00
PassInstrumentation.cpp
PassManager.cpp
PassRegistry.cpp
PassTimingInfo.cpp [Legacy][TimePasses] allow -time-passes reporting into a custom stream 2019-03-22 23:11:08 +00:00
ProfileSummary.cpp
RemarkStreamer.cpp [Remarks][NFC] Move the serialization to lib/Remarks 2019-05-30 21:45:59 +00:00
SafepointIRVerifier.cpp SafepointIRVerifier port to new Pass Manager 2019-03-31 10:15:39 +00:00
Statepoint.cpp
SymbolTableListTraitsImpl.h
Type.cpp [SVE][IR] Scalable Vector IR Type 2019-05-29 12:22:54 +00:00
TypeFinder.cpp
Use.cpp
User.cpp
Value.cpp
ValueSymbolTable.cpp
Verifier.cpp Reapply: IR: add optional type to 'byval' function parameters 2019-05-30 18:48:23 +00:00