llvm-project/llvm/test/Transforms
Florian Hahn 1922570489 [SLP] Consider alternatives for cost of select instructions.
Some architectures do not have general vector select instructions (e.g.
AArch64). But some cmp/select patterns can be vectorized using other
instructions/intrinsics.

One example is using min/max instructions for certain patterns.

This patch updates the cost calculations for selects in the SLP
vectorizer to consider using min/max intrinsics.

This patch does not change SLP vectorizer's codegen itself to actually
generate those intrinsics, but relies on the backends to lower the
vector cmps & selects. This keeps things simple on the SLP side and
works well in practice for AArch64.

This exposes additional SLP vectorization opportunities in some
benchmarks on AArch64 (-O3 -flto).

Metric: SLP.NumVectorInstructions

Program                                        base    slp     diff
 test-suite...ications/JM/ldecod/ldecod.test   502.00  697.00  38.8%
 test-suite...ications/JM/lencod/lencod.test   1023.00 1414.00 38.2%
 test-suite...-typeset/consumer-typeset.test    56.00   65.00  16.1%
 test-suite...6/464.h264ref/464.h264ref.test   804.00  822.00   2.2%
 test-suite...006/453.povray/453.povray.test   3335.00 3357.00  0.7%
 test-suite...CFP2000/177.mesa/177.mesa.test   2110.00 2121.00  0.5%
 test-suite...:: External/Povray/povray.test   2378.00 2382.00  0.2%

Reviewed By: RKSimon, samparker

Differential Revision: https://reviews.llvm.org/D89969
2020-10-29 20:39:50 +00:00
..
ADCE
AddDiscriminators
AggressiveInstCombine [AggressiveInstCombine] foldAnyOrAllBitsSet - add uniform vector support 2020-10-15 11:02:35 +01:00
AlignmentFromAssumptions Reland [AssumeBundles] Use operand bundles to encode alignment assumptions 2020-09-12 15:36:06 +02:00
ArgumentPromotion [test] Simplify pr33641_remove_arg_dbgvalue.ll 2020-10-23 15:36:05 -07:00
AtomicExpand AMDGPU: Check global FP atomics match default FP mode 2020-09-23 09:07:50 -04:00
Attributor [Attributor][NFC] Rerun update test script 2020-10-29 00:45:32 -05:00
BDCE [DemandedBits][BDCE] Add support for min/max intrinsics 2020-09-10 22:13:31 +02:00
BlockExtractor [BlockExtract][NewPM] Port -extract-blocks to NPM 2020-10-21 12:51:11 -07:00
BranchFolding
CallSiteSplitting Re-enable "[InstCombine] Simplify boolean Phis with const inputs using CFG" 2020-07-16 16:09:08 +07:00
CalledValuePropagation
CanonicalizeAliases
CanonicalizeFreezeInLoops
CodeExtractor Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-27 09:26:21 -04:00
CodeGenPrepare [CodeGenPrepare] Fix zapping dead operands of assume 2020-09-14 11:46:34 +07:00
ConstantHoisting
ConstantMerge
ConstraintElimination [ConstraintElimination] Add add/sub/and/or test cases. 2020-10-13 13:18:32 +01:00
Coroutines Recommit "[DSE] Switch to MemorySSA-backed DSE by default." 2020-10-16 09:02:53 +01:00
CorrelatedValuePropagation Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-27 09:26:21 -04:00
CrossDSOCFI
DCE
DeadArgElim [IR] Make nosync, nofree and willreturn default for intrinsics. 2020-10-20 11:57:19 +02:00
DeadStoreElimination [DSE] Use walker to skip noalias stores between current & clobber def. 2020-10-28 11:01:25 +00:00
DivRemPairs [ValueTracking] Let isGuaranteedNotToBeUndefOrPoison use canCreateUndefOrPoison 2020-07-20 09:21:39 +09:00
EarlyCSE Clean up test file, NFC 2020-09-23 15:32:46 -05:00
EliminateAvailableExternally
EntryExitInstrumenter Re-land "[PowerPC] Remove QPX/A2Q BGQ/BGP CNK support" 2020-07-28 14:00:11 +00:00
ExpandMemCmp
FixIrreducible [FixIrreducible][NewPM] Port -fix-irreducible to NPM 2020-10-09 09:22:09 -07:00
Float2Int
ForcedFunctionAttrs Force Remove Attribute 2020-08-19 17:30:13 -04:00
FunctionAttrs [FunctionAttrs] Rename functionattrs -> function-attrs 2020-07-28 09:09:13 -07:00
FunctionImport
GCOVProfiling [gcov] Add spanning tree optimization 2020-09-13 00:07:31 -07:00
GVN [GVN LoadPRE] Add an option to disable splitting backedge 2020-10-27 11:59:52 +07:00
GVNHoist [EarlyCSE] Verify hash code in regression tests 2020-09-04 10:40:35 -04:00
GVNSink [GVNSink][NewPM] Add GVNSinkPass to PassRegistry.def 2020-09-22 08:24:09 -07:00
GlobalDCE [FunctionAttrs] Rename functionattrs -> function-attrs 2020-07-28 09:09:13 -07:00
GlobalMerge
GlobalOpt [globalopt] Teach to look through `addrspacecast`. 2020-10-16 08:43:09 -04:00
GlobalSplit
GuardWidening [NewPM][GuardWidening] Fix loop guard widening tests under NPM 2020-08-06 15:32:59 -07:00
HardwareLoops [SCEV] If Start>=RHS, simplify (Start smin RHS) = RHS for trip counts. 2020-08-03 17:22:42 +01:00
HelloNew Reland [docs][NewPM] Add docs for writing NPM passes 2020-09-14 16:06:19 -07:00
HotColdSplit [test] HotColdSplit: cover use of opaque pointer type 2020-10-22 12:25:50 -07:00
IRCE [IRCE] Do not transform if loop has small number of iterations 2020-10-20 10:33:59 +07:00
IndVarSimplify Return "[IndVars] Remove monotonic checks with unknown exit count" 2020-10-28 18:51:40 +07:00
IndirectBrExpand
InferAddressSpaces InferAddressSpaces: Fix assert with unreachable code 2020-09-15 15:48:43 -04:00
InferFunctionAttrs [InferAttrs] Add nocapture/writeonly to string/mem libcalls 2020-10-29 20:06:43 +01:00
Inline Reland [AlwaysInliner] Pass callee AAResults to InlineFunction() 2020-10-26 20:40:46 -07:00
InstCombine [InstCombine] visitShl - ensure inner shifts have inrange amounts 2020-10-29 15:28:15 +00:00
InstMerge [BasicAA] Rename deprecated -basicaa to -basic-aa 2020-06-26 20:41:37 -07:00
InstNamer Port -instnamer to NPM 2020-10-22 12:08:36 -07:00
InstSimplify [InstSimplify] peek through 'not' operand in logic-of-icmps fold 2020-10-25 11:13:30 -04:00
InterleavedAccess [InterleaveAccess] Recognise Interleave loads through binary operations 2020-10-29 09:13:23 +00:00
Internalize
JumpThreading [testing] Add missing REQUIRES: asserts 2020-10-28 06:14:54 -04:00
LCSSA [NewPM][LoopUnswitch] Pin loop-unswitch to legacy PM or use simple-loop-unswitch 2020-08-06 10:56:00 -07:00
LICM [AArch64][SVE] Drop "argmemonly" from gather/scatter with vector base. 2020-09-25 16:01:05 -07:00
LoadStoreVectorizer Revert "[AMDGPU] Reorganize GCN subtarget features for unaligned access" 2020-09-29 15:33:34 +02:00
LoopDataPrefetch Re-land "[PowerPC] Remove QPX/A2Q BGQ/BGP CNK support" 2020-07-28 14:00:11 +00:00
LoopDeletion [test] Fix LoopDeletion tests under NPM 2020-10-21 18:32:35 -07:00
LoopDistribute [LoopVersioning] Form dedicated exits for versioned loop to preserve simplify form 2020-10-24 21:40:46 +08:00
LoopFlatten [LoopFlatten] Precommit new test cases. NFC. 2020-10-14 10:09:40 +01:00
LoopFusion [Loop Fusion] Integrate Loop Peeling into Loop Fusion (re-land after fixing ASAN build failures) 2020-07-23 21:02:04 +00:00
LoopIdiom [InferAttrs] Add nocapture/writeonly to string/mem libcalls 2020-10-29 20:06:43 +01:00
LoopInstSimplify
LoopInterchange [LoopInterchange][NewPM] Port -loop-interchange to NPM 2020-10-09 09:21:31 -07:00
LoopLoadElim [LoopLoadElim] Filter away candidates that stop being AddRecs after loop versioning. PR47457 2020-09-10 13:30:31 +07:00
LoopPredication [BasicAA] Rename deprecated -basicaa to -basic-aa 2020-06-26 20:41:37 -07:00
LoopReroll [SCEV] Strength nowrap flags after constant folding 2020-10-25 18:00:22 +01:00
LoopRotate [LoopRotate][NPM] Disable header duplication under -Oz 2020-10-22 08:39:12 -07:00
LoopSimplify [test] Fix tests using -analyze that fail under NPM 2020-10-21 21:54:30 -07:00
LoopSimplifyCFG [LoopSimplifyCFG][NewPM] Rename simplify-cfg -> loop-simplifycfg 2020-09-21 08:27:19 -07:00
LoopStrengthReduce [test] Fix tests using -analyze that fail under NPM 2020-10-21 21:54:30 -07:00
LoopTransformWarning
LoopUnroll Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-27 09:26:21 -04:00
LoopUnrollAndJam [LoopUnrollAndJam] Allow unroll and jam loops forced by user. 2020-09-17 19:40:14 +00:00
LoopUnswitch Reland "[LoopUnswitch] Fix incorrect Modified status" 2020-08-20 11:52:09 +02:00
LoopVectorize [Deref] Use maximum trip count instead of exact trip count 2020-10-28 14:33:30 -07:00
LoopVersioning [LoopVersioning] Form dedicated exits for versioned loop to preserve simplify form 2020-10-24 21:40:46 +08:00
LoopVersioningLICM [NPM] Port -loop-versioning-licm to NPM 2020-10-24 21:51:18 +08:00
LowerAtomic
LowerConstantIntrinsics IR: Define byref parameter attribute 2020-07-20 10:23:09 -04:00
LowerExpectIntrinsic Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-27 09:26:21 -04:00
LowerGuardIntrinsic
LowerInvoke
LowerMatrixIntrinsics [LowerMatrixIntrinsics][NewPM] Fix PreservedAnalyses result 2020-10-21 12:42:16 -07:00
LowerSwitch [LowerSwitch][NewPM] Port lowerswitch to NPM 2020-09-15 18:18:31 -07:00
LowerTypeTests [AArch64] Add BTI to CFI jumptables. 2020-09-29 13:50:23 +02:00
LowerWidenableCondition
MakeGuardsExplicit
Mem2Reg [Mem2Reg] Teach promote to register about droppable instructions 2020-07-24 15:15:38 -05:00
MemCpyOpt [MemCpyOpt] Move GEP during call slot optimization 2020-10-22 20:40:56 +02:00
MergeFunc
MergeICmps
MetaRenamer [MetaRenamer][NewPM] Port metarenamer to NPM 2020-10-02 15:42:25 -07:00
NameAnonGlobals
NaryReassociate [EarlyCSE] Verify hash code in regression tests 2020-09-04 10:40:35 -04:00
NewGVN [DIE] Remove DeadInstEliminationPass 2020-09-21 12:12:25 -07:00
ObjCARC Port -objc-arc-expand to NPM 2020-10-26 20:05:10 -07:00
OpenMP Revert "[OpenMP] Add Passing in Original Declaration Names To Mapper API" 2020-10-28 13:58:14 +01:00
PGOProfile Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-27 09:26:21 -04:00
PartialInlining [Partial Inliner] Compute intrinsic cost through TTI 2020-09-16 15:12:31 +01:00
PartiallyInlineLibCalls
PhaseOrdering [NFC][PhaseOrdering] Autogenerate basic.ll test 2020-10-27 14:42:53 +03:00
PlaceSafepoints [PlaceSafepoints] Pin tests to legacy PM 2020-10-26 20:07:37 -07:00
PreISelIntrinsicLowering
PruneEH
Reassociate [Reassociate][test] Delete improper -NOT patterns to work with -enable-new-pm=1 2020-10-28 23:59:11 -07:00
Reg2Mem [Reg2Mem][NewPM] Pin test to legacy PM 2020-10-09 12:36:08 -07:00
RewriteStatepointsForGC GC-parseable element atomic memcpy/memmove 2020-10-23 14:06:09 -07:00
SCCP Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-27 09:26:21 -04:00
SLPVectorizer [SLP] Consider alternatives for cost of select instructions. 2020-10-29 20:39:50 +00:00
SROA Fix SROA with a PHI mergig values from a same block 2020-10-26 12:58:27 -07:00
SafeStack [StackSafety] Ignore allocas with partial lifetime markers 2020-08-27 13:54:41 -07:00
SampleProfile Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-27 09:26:21 -04:00
ScalarizeMaskedMemIntrin [ScalarizeMaskedMemIntrin][X86] Refresh missed transform test cases from rGc0c3b9a25fee 2020-08-10 11:14:01 +01:00
Scalarizer [Scalarizer] Avoid changing name of non-instructions 2020-09-15 14:15:50 +02:00
SeparateConstOffsetFromGEP
SimpleLoopUnswitch Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-27 09:26:21 -04:00
SimplifyCFG [Utils] Skip RemoveRedundantDbgInstrs in MergeBlockIntoPredecessor (PR47746) 2020-10-27 10:12:59 -07:00
Sink Sink: Handle instruction sink when a user is dead 2020-10-09 16:20:26 -07:00
SpeculateAroundPHIs
SpeculativeExecution SpeculativeExecution: Fix for logic change introduced in D81730. 2020-07-09 15:45:23 +03:00
StraightLineStrengthReduce [NPM] Port -slsr to NPM 2020-10-27 09:21:40 +08:00
StripDeadPrototypes
StripSymbols [NewPM] Port strip* passes to NPM 2020-09-15 18:25:12 -07:00
StructurizeCFG [StructurizeCFG][NewPM] Port -structurizecfg to NPM 2020-10-23 15:54:03 -07:00
SyntheticCountsPropagation
TailCallElim Revert "[TRE] allow TRE for non-capturing calls." 2020-07-13 00:39:48 +03:00
ThinLTOBitcodeWriter
TypePromotion/ARM
UnifyFunctionExitNodes [NPM] Port -mergereturn to NPM 2020-10-20 10:33:58 -07:00
UnifyLoopExits [NPM] port -unify-loop-exits to NPM 2020-10-20 10:46:57 -07:00
UniqueInternalLinkageNames Prepend "__uniq" to symbol names hash with -funique-internal-linkage-names. 2020-10-26 14:24:28 -07:00
Util Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-27 09:26:21 -04:00
VectorCombine [VectorCombine] Avoid crossing address space boundaries. 2020-10-16 13:19:31 -07:00
WholeProgramDevirt [WholeProgramDevirt][NewPM] Add NPM testing path to match legacy pass 2020-09-30 17:27:37 -07:00