llvm-project/llvm/test/Transforms
Craig Topper f14e62c9a5 [EarlyCSE] Improve EarlyCSE of some absolute value cases.
Change matchSelectPattern to return X and -X for ABS/NABS in a well defined order. Adjust EarlyCSE to account for this. Ensure the SPF result is some kind of min/max and not abs/nabs in one place in InstCombine that made me nervous.

Prevously we returned the two operands of the compare part of the abs pattern. The RHS is always going to be a 0i, 1 or -1 constant. This isn't a very meaningful thing to return for any one. There's also some freedom in the abs pattern as to what happens when the value is equal to 0. This freedom led to early cse failing to match when different constants were used in otherwise equivalent operations. By returning the input and its negation in a defined order we can ensure an exact match. This also makes sure both patterns use the exact same subtract instruction for the negation. I believe CSE should evebntually make this happen and properly merge the nsw/nuw flags. But I'm not familiar with CSE and what order it does things in so it seemed like it might be good to really enforce that they were the same.

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

llvm-svn: 332865
2018-05-21 18:42:42 +00:00
..
ADCE [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
AddDiscriminators [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
AggressiveInstCombine [AggressiveInstCombine] avoid crashing on unsimplified code (PR37446) 2018-05-14 13:43:32 +00:00
AlignmentFromAssumptions [AlignmentFromAssumptions] Set source and dest alignments of memory intrinsiscs separately 2018-02-22 18:55:59 +00:00
ArgumentPromotion [ArgumentPromotion] don't break musttail invariant PR36543 2018-03-02 00:59:27 +00:00
AtomicExpand
BDCE [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
BlockExtractor BlockExtractor: Don’t delete functions directly 2018-03-12 22:28:18 +00:00
BranchFolding
CallSiteSplitting [CallSiteSplit] Make sure we remove nonnull if the parameter turns out to be a constant. 2018-04-23 20:09:08 +00:00
CalledValuePropagation
CodeExtractor [CodeExtractor] Allow extracting blocks with exception handling 2018-05-11 22:49:49 +00:00
CodeGenPrepare Dissallow non-empty metadata for invariant.group 2018-05-18 23:53:46 +00:00
ConstProp
ConstantHoisting [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
ConstantMerge
Coroutines [Coroutines] PR34897: Fix incorrect elisions 2018-05-11 03:12:28 +00:00
CorrelatedValuePropagation [CVP] Require DomTree for new Pass Manager 2018-05-21 11:06:28 +00:00
CrossDSOCFI
DCE [DCE] Salvage debug info from dead insts 2018-02-15 22:26:18 +00:00
DeadArgElim [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
DeadStoreElimination [DSE] Teach the pass about partial overwrite of atomic memory intrinsics 2018-05-10 15:12:49 +00:00
DivRemPairs
EarlyCSE [EarlyCSE] Improve EarlyCSE of some absolute value cases. 2018-05-21 18:42:42 +00:00
EliminateAvailableExternally
EntryExitInstrumenter [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
ExpandMemCmp/X86
Float2Int
ForcedFunctionAttrs
FunctionAttrs [CaptureTracking] Handle capturing of launder.invariant.group 2018-05-05 10:23:27 +00:00
FunctionImport [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
GCOVProfiling [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
GVN Dissallow non-empty metadata for invariant.group 2018-05-18 23:53:46 +00:00
GVNHoist [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
GVNSink
GlobalDCE
GlobalMerge
GlobalOpt Fix evaluator for non-zero alloca addr space 2018-05-19 02:58:16 +00:00
GlobalSplit
GuardWidening [LoopGuardWidening] Make PostDomTree optional 2018-04-27 23:15:56 +00:00
IPConstantProp [IPSCCP] do not break musttail invariant (PR36485) 2018-03-01 01:19:18 +00:00
IRCE [IRCE] Fix miscompile with range checks against negative values 2018-05-19 13:06:37 +00:00
IndVarSimplify [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
IndirectBrExpand
InferAddressSpaces [AMDGPU] Switch to the new addr space mapping by default 2018-02-02 16:07:16 +00:00
InferFunctionAttrs [SimplifyLibcalls] Replace locked IO with unlocked IO 2018-05-16 11:39:52 +00:00
Inline [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
InstCombine [InstCombine] Fix PR37526: MinMax patterns produce an infinite loop. 2018-05-21 17:46:34 +00:00
InstMerge [MergedLoadStoreMotion] Fix a debug invariant bug in mergeStores 2018-05-09 06:52:12 +00:00
InstNamer
InstSimplify [InstCombine] choose 1 form of abs and nabs as canonical 2018-05-20 14:23:23 +00:00
InterleavedAccess
Internalize
JumpThreading Fix the issue that ComputeValueKnownInPredecessors only handles the case when 2018-05-01 14:47:24 +00:00
LCSSA [LCSSA] Do not remove used PHI nodes in formLCSSAForInstructions 2018-05-08 06:59:47 +00:00
LICM [LICM] Extend the MustExecute scope 2018-05-18 04:56:28 +00:00
LoadStoreVectorizer [LoadStoreVectorize] Ignore interleaved invariant loads. 2018-04-24 15:28:47 +00:00
LoopDataPrefetch [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
LoopDeletion
LoopDistribute [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
LoopIdiom [LoopIdiomRecognize] Add a test case to show incorrect transformation of an infinite loop with side effets into a countable loop using ctlz. 2018-05-03 23:50:29 +00:00
LoopInterchange [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
LoopLoadElim
LoopPredication [LoopPredication] Add profitability check based on BPI 2018-03-22 16:03:59 +00:00
LoopReroll [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
LoopRotate [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
LoopSimplify [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
LoopSimplifyCFG
LoopStrengthReduce [AMDGPU] Move lsr test. NFC. 2018-05-17 01:30:51 +00:00
LoopUnroll [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
LoopUnswitch [NFC] Use FileCheck in test 2018-04-24 04:42:37 +00:00
LoopVectorize [VPlan] Reland r332654 and silence unused func warning 2018-05-21 18:14:23 +00:00
LoopVersioning
LoopVersioningLICM
LowerAtomic
LowerExpectIntrinsic
LowerGuardIntrinsic
LowerInvoke
LowerSwitch
LowerTypeTests revert r332610, it breaks cfi, see D46326 2018-05-21 11:44:39 +00:00
Mem2Reg [Debugify] Print the output to stderr 2018-05-17 18:19:58 +00:00
MemCpyOpt [MemCpyOpt] Skip optimizing basic blocks not reachable from entry 2018-04-23 19:55:04 +00:00
MergeFunc [MergeFunctions] Fix merging of small weak functions 2018-05-15 11:31:07 +00:00
MergeICmps [MergeICmps] Don't crash when memcmp is not available 2018-05-19 12:51:59 +00:00
MetaRenamer
NameAnonGlobals
NaryReassociate Add early exit on reassociation of 0 expression. 2018-03-07 02:17:08 +00:00
NewGVN Dissallow non-empty metadata for invariant.group 2018-05-18 23:53:46 +00:00
ObjCARC [ObjCARC] Prevent code motion into a catchswitch 2018-05-16 04:52:18 +00:00
PGOProfile [ICP] Do not attempt type matching for variable length arguments. 2018-04-25 17:19:21 +00:00
PartiallyInlineLibCalls
PhaseOrdering [PhaseOrdering] remove stale comments; NFC 2018-05-09 23:10:46 +00:00
PlaceSafepoints
PreISelIntrinsicLowering
PruneEH [PM][FunctionAttrs] add NoUnwind attribute inference to PostOrderFunctionAttrs pass 2018-03-23 21:46:16 +00:00
Reassociate [Reassociate] Prevent infinite loops when processing PHIs. 2018-05-11 15:45:36 +00:00
Reg2Mem
RewriteStatepointsForGC [RewriteStatepoints] Fix stale parse points 2018-03-05 22:27:30 +00:00
SCCP Revert r328307: [IPSCCP] Use constant range information for comparisons of parameters. 2018-03-23 12:49:39 +00:00
SLPVectorizer [AMDGPU] Support horizontal vectorization of min/max. 2018-05-09 21:18:34 +00:00
SROA [SROA] Handle PHI with multiple duplicate predecessors 2018-05-17 07:21:41 +00:00
SafeStack [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
SampleProfile [SampleFDO] Don't treat warm callsite with inline instance in the profile as cold 2018-05-10 23:02:27 +00:00
Scalarizer [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
SeparateConstOffsetFromGEP [Split GEP] handle trunc() in separate-const-offset-from-gep pass. 2018-05-11 21:13:19 +00:00
SimpleLoopUnswitch [PM/LoopUnswitch] Fix a bug in the loop block set formation of the new 2018-04-24 10:33:08 +00:00
SimplifyCFG [SimplifyCFG] Fix a debug invariant bug in FoldBranchToCommonDest() 2018-05-18 08:52:15 +00:00
Sink
SpeculateAroundPHIs
SpeculativeExecution
StraightLineStrengthReduce
StripDeadPrototypes
StripSymbols
StructurizeCFG StructurizeCFG: fix inverting conditions 2018-05-15 21:41:55 +00:00
SyntheticCountsPropagation
TailCallElim [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
ThinLTOBitcodeWriter Fix build failures for r330387 on buildbots that don't build the X86 target 2018-04-20 02:26:12 +00:00
Util Require DominatorTree when requiring/preserving LoopInfo in the old pass manager 2018-05-17 09:05:40 +00:00
WholeProgramDevirt Runtime flag to control branch funnel threshold 2018-04-06 21:32:36 +00:00