llvm-project/llvm/test/Transforms
Sanjay Patel 2e87333bfe [InstCombine] convert mul by negative-pow2 to negate and shift
This is an unusual canonicalization because we create an extra instruction,
but it's likely better for analysis and codegen (similar reasoning as D133399).

InstCombine::Negator may create this kind of multiply from negate and shift,
but this should not conflict because of the narrow negation.

I don't know how to create a fully general proof for this kind of transform in
Alive2, but here's an example with bitwidths similar to one of the regression
tests:
https://alive2.llvm.org/ce/z/J3jTjR

Differential Revision: https://reviews.llvm.org/D133667
2022-10-02 12:22:25 -04:00
..
ADCE [ADCE] Update tests to use opaque pointers (NFC) 2022-06-22 12:26:12 +02:00
AddDiscriminators [AddDiscriminators] Migrate tests to opaque pointers (NFC) 2022-06-22 12:47:12 +02:00
AggressiveInstCombine [AggressiveInstCombine] Combine consecutive loads which are being merged to form a wider load. 2022-09-28 17:32:47 +01:00
AlignmentFromAssumptions [AlignmentFromAssumptions] Migrate tests to opaque pointers (NFC) 2022-06-22 13:57:47 +02:00
ArgumentPromotion [ArgPromotion] Transfer metadata nontemporal to promoted loads 2022-07-26 16:30:08 +08:00
AtomicExpand AtomicExpand: Add some more overaligned atomic tests 2022-09-28 12:51:30 -04:00
Attributor [AAPointerInfo] OffsetInfo: Unassigned is distinct from Unknown 2022-09-28 20:31:36 +05:30
BDCE
BlockExtractor [IR] Enable opaque pointers by default 2022-06-02 09:40:56 +02:00
BranchFolding
CallSiteSplitting [IR] Don't use blockaddresses as callbr arguments 2022-07-15 10:18:17 +02:00
CalledValuePropagation
CanonicalizeAliases [LegacyPM] Remove LTO passes from optimization pipeline 2022-07-17 14:24:36 -07:00
CanonicalizeFreezeInLoops
CodeExtractor [test] Update some legacy PM tests 2022-09-30 11:31:02 -07:00
CodeGenPrepare [CGP] Update failing test missed in 81a11da762. 2022-09-15 19:35:25 +01:00
ConstantHoisting [test] Update some legacy PM tests 2022-09-30 11:31:02 -07:00
ConstantMerge
ConstraintElimination [ConstraintElimination] Update Changed status in ssub simplification. 2022-10-02 14:25:51 +01:00
Coroutines Revert rG1b7089fe67b924bdd5ecef786a34bdba7a88778f "[SLP] Add ScalarizationOverheadBuilder helper to track vector extractions" 2022-09-30 11:22:48 +01:00
CorrelatedValuePropagation [DebugInfo] Missing debug location after replacement in processSRem function 2022-09-01 13:18:17 +01:00
CrossDSOCFI
DCE [DCE] Update tests to use opaque pointers (NFC) 2022-06-10 17:31:35 +02:00
DFAJumpThreading [NFC] Switch a few uses of undef to poison as placeholders for unreachble code 2022-07-03 14:34:03 +01:00
DeadArgElim [Globals] Treat nobuiltin fns as maybe-derefined. 2022-08-23 13:45:10 +01:00
DeadStoreElimination [DSE] Eliminate noop store even through has clobbering between LoadI and StoreI 2022-09-29 00:51:56 +00:00
DivRemPairs [Mips] Implement hasDivRemOp() 2022-05-16 14:45:40 +08:00
EarlyCSE [EarlyCSE][ConstantFolding] do not constant fold atan2(+/-0.0, +/-0.0), part 2 2022-08-20 10:16:06 -04:00
EliminateAvailableExternally
EntryExitInstrumenter
ExpandMemCmp [ExpandMemCmp] Properly expand `bcmp` to an equality pattern. 2022-04-15 11:26:24 +02:00
FixIrreducible [FixIrreducible][opt] Mark -fix-irreducible as a codegen pass 2022-09-30 10:34:04 -07:00
Float2Int [Float2Int] Make sure dependent ranges are calculated first (PR54669) 2022-04-04 10:18:39 +02:00
ForcedFunctionAttrs
FunctionAttrs Reapply [FunctionAttrs] Infer precise FMRB 2022-09-29 14:02:15 +02:00
FunctionImport [test] Change -function-import tests to use -passes= 2022-07-17 21:43:00 -07:00
FunctionSpecialization [SCCP] Don't mark edges feasible when resolving undefs 2022-06-22 10:28:27 +02:00
GCOVProfiling [InstrProf] Add the skipprofile attribute 2022-08-04 08:45:27 -07:00
GVN [NFC][1/n] Remove -enable-new-pm=0 flags from lit tests 2022-09-19 09:57:37 -07:00
GVNHoist [GVNHoist] drop debug location according to the debug info guide 2022-03-30 20:17:53 -07:00
GVNSink Revert "[SimplifyCFG] Thread branches on same condition in more cases (PR54980)" 2022-07-05 16:57:46 +02:00
GlobalDCE
GlobalMerge Fix the eh-filter.ll test. 2022-06-29 16:14:41 -05:00
GlobalOpt [IR] Don't allow DLL storage-class and local linkage 2022-09-30 00:26:01 +01:00
GlobalSplit
GuardWidening [GuardWidening] Add tests showing incorrect behavior of GW. 2022-06-29 13:41:59 +07:00
HardwareLoops
HelloNew
HotColdSplit [IR] Enable opaque pointers by default 2022-06-02 09:40:56 +02:00
IRCE [IRCE] Bail in case of pointer types. PR40539 2022-09-12 16:01:25 +07:00
IROutliner [IR] Don't use blockaddresses as callbr arguments 2022-07-15 10:18:17 +02:00
IndVarSimplify [SCEVExpander] Move LCSSA fixup to ::expand. 2022-09-29 20:49:56 +01:00
IndirectBrExpand
InferAddressSpaces [DebugInfo][InferAddressSpaces] Propagate DebugLoc when cloning an instruction in InferAddressSpaces 2022-09-29 08:43:37 +00:00
InferFunctionAttrs [InstCombine] Tighten up known library function signature tests (PR #56463) 2022-08-10 14:15:46 -06:00
Inline [MemProf] Update metadata during inlining 2022-09-30 19:21:15 -07:00
InstCombine [InstCombine] convert mul by negative-pow2 to negate and shift 2022-10-02 12:22:25 -04:00
InstMerge
InstNamer
InstSimplify [ValueTracking] peek through fpext in isKnownNeverInfinity() 2022-10-02 11:20:23 -04:00
InterleavedAccess [IR] Move vector.insert/vector.extract out of experimental namespace 2022-06-27 10:48:45 +00:00
Internalize [Internalize] Support glob patterns for API lists 2022-07-22 08:24:32 -04:00
JumpThreading [NFC][2/n] Remove PrunePH pass 2022-09-26 18:38:04 -07:00
LCSSA [LCSSA] Update unreachable uses with poison. 2022-09-04 22:26:18 +01:00
LICM [LICM] Add test for PR57780 (NFC) 2022-09-20 13:07:11 +02:00
LoadStoreVectorizer [AMDGPU][FIX] Proper load-store-vectorizer result with opaque pointers 2022-04-15 13:42:46 -05:00
LoopBoundSplit
LoopDataPrefetch [LoopDataPrefetch] Fix crash when TTI doesn't set CacheLineSize 2022-07-26 13:08:42 +08:00
LoopDeletion [test] Update some legacy PM tests 2022-09-30 11:31:02 -07:00
LoopDistribute [LAA] Change to function analysis for new PM. 2022-10-01 15:44:27 +01:00
LoopFlatten [Test] Regenerate tests using update_tests.py 2022-08-19 14:51:19 +07:00
LoopFusion [LoopFuse] Drop loop dispositions before reassigning blocks to other loop 2022-09-19 17:43:06 +07:00
LoopIdiom [LoopIdiom] Add non-LZCNT target test coverage 2022-09-19 18:13:11 +01:00
LoopInstSimplify [LoopInstSimplify] Ignore users in unreachable blocks. PR55072 2022-04-25 17:35:28 +07:00
LoopInterchange [LoopInterchange][PR57148] Ensure the correct form of IR after transformation 2022-09-22 00:20:53 -04:00
LoopLoadElim [LoopVersioning] Add tests where versioning requires LAA invalidation. 2022-09-24 20:33:49 +01:00
LoopPredication Loop names used in reporting can grow very large 2022-09-09 13:45:14 -04:00
LoopReroll
LoopRotate [LoopRotate] Drop loop dispositions when rotating loops. PR56260 2022-09-19 18:01:02 +07:00
LoopSimplify [BasicBlockUtils] Amend test for loop metadata. 2022-08-30 09:29:52 -07:00
LoopSimplifyCFG [LoopSimplifyCFG] Prevent use-def dominance breach by handling dead exits. PR56243 2022-07-19 15:54:12 +07:00
LoopStrengthReduce X86: Stop assigning register costs for longer encodings. 2022-09-30 16:01:33 -07:00
LoopTransformWarning
LoopUnroll [LAA] Change to function analysis for new PM. 2022-10-01 15:44:27 +01:00
LoopUnrollAndJam
LoopVectorize [LAA] Change to function analysis for new PM. 2022-10-01 15:44:27 +01:00
LoopVersioning [LoopVersioning] Add tests where versioning requires LAA invalidation. 2022-09-24 20:33:49 +01:00
LoopVersioningLICM [NFC][1/n] Remove -enable-new-pm=0 flags from lit tests 2022-09-19 09:57:37 -07:00
LowerAtomic [NFC] Switch a few uses of undef to poison as placeholders for unreachable code 2022-07-23 21:50:11 +01:00
LowerConstantIntrinsics tests: add attributes that would normally come from inferattrs 2022-07-25 17:29:00 -04:00
LowerExpectIntrinsic
LowerGlobalDestructors Reland "Lower `@llvm.global_dtors` using `__cxa_atexit` on MachO" 2022-03-23 18:36:55 -07:00
LowerGuardIntrinsic
LowerInvoke
LowerMatrixIntrinsics [Matrix] Add tests for addition transpose optimizations 2022-09-26 13:27:03 -07:00
LowerSwitch LowerSwitch: Avoid inserting NewDefault block 2022-04-14 13:30:56 +08:00
LowerTypeTests [test] Change -lowertypetests tests to -passes= 2022-07-17 15:03:46 -07:00
LowerWidenableCondition
MakeGuardsExplicit
Mem2Reg [Mem2Reg] Consistently preserve nonnull assume for uninit load 2022-07-12 12:53:08 +02:00
MemCpyOpt [DSE] Support looking through memory phis at end of function. 2022-08-30 13:27:51 +01:00
MergeFunc [llvm] Handle dso_local_equivalent in FunctionComparator 2022-09-22 18:42:31 +00:00
MergeICmps
MetaRenamer [TLI] Check that malloc argument has type size_t 2022-03-14 17:22:24 +01:00
NameAnonGlobals [LegacyPM] Remove LTO passes from optimization pipeline 2022-07-17 14:24:36 -07:00
NaryReassociate
NewGVN [NewGVN][PHIOFOPS] Bail out if an operand is in OpSafeForPHIOfOps but it is not safe for the current basic block. 2022-08-17 18:57:46 -07:00
ObjCARC [llvm] Migrate PAEval to new pass manager 2022-10-01 16:41:58 -07:00
OpenMP [test] Update some legacy PM tests 2022-09-30 11:31:02 -07:00
PGOProfile Restore "[MemProf] Memprof profile matching and annotation" 2022-09-23 11:38:47 -07:00
PartialInlining
PartiallyInlineLibCalls [PartiallyInlineLibCalls] Don't partially inline a musttail libcall. 2022-04-05 22:30:50 +03:00
PhaseOrdering [InstSimplify] look through vector select (shuffle) in min/max fold 2022-09-30 08:27:00 -04:00
PlaceSafepoints
PreISelIntrinsicLowering
Reassociate [InstCombine] try to fold mul by neg-power-of-2 to shl 2022-09-21 15:09:39 -04:00
Reg2Mem
RelLookupTableConverter/X86 [RelLookupTableConverter] Bail on invalid pointer size (x32) 2022-08-09 09:36:39 +02:00
RewriteStatepointsForGC [RS4GC] Handle vectors of pointers in non-live clobbering 2022-08-16 17:47:30 +03:00
SCCP [SCCP] regenerate test checks; NFC 2022-09-30 10:26:01 -04:00
SLPVectorizer [test] Update some legacy PM tests 2022-09-30 11:31:02 -07:00
SROA Revert "[SROA] Create additional vector type candidates based on store and load slices" 2022-09-23 12:24:07 -07:00
SafeStack [safestack] Support safestack in stack size diagnostics 2022-04-20 18:29:40 +00:00
SampleProfile [llvm][misexpect] Re-enable MisExpect for SampleProfiling 2022-08-26 20:24:10 +00:00
ScalarizeMaskedMemIntrin
Scalarizer [NFC][Scalarizer] Let testcase be auto-generated from update_test_check 2022-09-21 02:05:09 -07:00
SeparateConstOffsetFromGEP [AArch64] Move SeparateConstOffsetFromGEPPass before LSR and enable EnableGEPOpt by default. 2022-07-22 15:20:53 +01:00
SimpleLoopUnswitch [SimpleLoopUnswitch] Pass -verify-cfg-preserved to test. 2022-10-01 17:19:02 +01:00
SimplifyCFG [test] Update some legacy PM tests 2022-09-30 11:31:02 -07:00
Sink [Sink] Don't sink non-willreturn calls (PR51188) 2022-04-07 16:35:05 +02:00
SpeculativeExecution
StraightLineStrengthReduce
StripDeadPrototypes
StripSymbols [StripDeadDebugInfo] Drop dead CUs 2022-09-11 01:31:03 -07:00
StructurizeCFG [StructurizeCFG][opt] Mark -structurizecfg as a codegen pass 2022-09-30 10:27:09 -07:00
SyntheticCountsPropagation
TailCallElim KCFI sanitizer 2022-08-24 22:41:38 +00:00
ThinLTOBitcodeWriter
TypePromotion [NFC][TypePromotion] Add test 2022-09-05 09:01:23 +01:00
UnifyFunctionExitNodes [NFC][1/n] Remove -enable-new-pm=0 flags from lit tests 2022-09-19 09:57:37 -07:00
UnifyLoopExits [NFC][1/n] Remove -enable-new-pm=0 flags from lit tests 2022-09-19 09:57:37 -07:00
Util [test] Update some legacy PM tests 2022-09-30 11:31:02 -07:00
VectorCombine [VectorCombine] Only consider shuffle uses with the same type. 2022-07-16 13:23:39 +01:00
WholeProgramDevirt [NFC] Switch a few uses of undef to poison as placeholders for unreachble code 2022-07-03 14:34:03 +01:00