llvm-project/llvm/test/Transforms
Zain Jaffal f61f99a105
[instcombine] Optimise for zero initialisation of product given fast flags are enabled
Currently, clang ignores the 0 initialisation in finite math
For example:

```
double f_prod = 0;
double arr[1000];
for (size_t i = 0; i < 1000; i++) {
  f_prod *= arr[i];
 }
```
Clang will ignore that `f_prod` is set to zero and it will generate assembly to iterate over the loop.

Reviewed By: fhahn, spatel

Differential Revision: https://reviews.llvm.org/D131672
2022-08-17 11:12:15 +01: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] check sqrt operand to allow more libcall->intrinsic transforms 2022-07-27 11:36:13 -04: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 [LoongArch] Add codegen support for atomic fence, atomic load and atomic store 2022-07-13 15:25:45 +08:00
Attributor [Attributor][FIX] Visit same instructions with different scopes 2022-08-10 16:02:12 -05:00
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 [IR] Don't use blockaddresses as callbr arguments 2022-07-15 10:18:17 +02:00
CodeGenPrepare [test] Add missing REQUIRES: arm-registered-target 2022-07-20 10:59:07 -07:00
ConstantHoisting [RISCV] Disable constant hoisting for multiply by negated power of 2. 2022-07-27 09:37:59 -07:00
ConstantMerge
ConstraintElimination Recommit "[ConstraintElimination] Transfer info from ULT to signed system." 2022-06-24 09:27:14 +02:00
Coroutines [Coroutines] Maintain the position of final suspend 2022-08-12 13:05:08 +08:00
CorrelatedValuePropagation [CVP] Add coverage for missing mul/shl nowrap variants 2022-07-14 13:00:55 -07: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 [llvm] Add DW_CC_nocall to function debug metadata when either return values or arguments are removed 2022-06-15 03:30:15 +05:30
DeadStoreElimination [InstCombine] Tighten up known library function signature tests (PR #56463) 2022-08-10 14:15:46 -06:00
DivRemPairs [Mips] Implement hasDivRemOp() 2022-05-16 14:45:40 +08:00
EarlyCSE [FPEnv][EarlyCSE] Support for CSE when exception behavior is "ignore" or "maytrap" and the rounding mode is known. 2022-08-16 08:31:42 -04:00
EliminateAvailableExternally
EntryExitInstrumenter
ExpandMemCmp [ExpandMemCmp] Properly expand `bcmp` to an equality pattern. 2022-04-15 11:26:24 +02:00
FixIrreducible LowerSwitch: Avoid inserting NewDefault block 2022-04-14 13:30:56 +08:00
Float2Int [Float2Int] Make sure dependent ranges are calculated first (PR54669) 2022-04-04 10:18:39 +02:00
ForcedFunctionAttrs
FunctionAttrs [RPOFuncAttrs] Fix norecurse detection 2022-06-18 12:20:10 -07: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 tests: add attributes that would normally come from inferattrs 2022-07-25 17:29:00 -04: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 [GlobalDCE] [VFE] Avoid dropping vfunc dependencies when an invalid vtable entry is present 2022-02-17 19:41:46 -08:00
GlobalMerge Fix the eh-filter.ll test. 2022-06-29 16:14:41 -05:00
GlobalOpt tests: add attributes that would normally come from inferattrs 2022-07-25 17:29:00 -04: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 [SCEV] Fix isImpliedViaMerge() with values from previous iteration (PR56242) 2022-07-05 15:31:23 +02:00
IROutliner [IR] Don't use blockaddresses as callbr arguments 2022-07-15 10:18:17 +02:00
IndVarSimplify [Test] Add miscompiled test for PR57187 2022-08-17 15:46:30 +07:00
IndirectBrExpand
InferAddressSpaces [InferAddressSpaces] Check if AS are the same in isNoopPtrIntCastPair 2022-04-28 11:10:55 +08:00
InferFunctionAttrs [InstCombine] Tighten up known library function signature tests (PR #56463) 2022-08-10 14:15:46 -06:00
Inline [Inlining] Introduce the function attribute "inline-max-stacksize" 2022-08-12 11:07:18 -07:00
InstCombine [instcombine] Optimise for zero initialisation of product given fast flags are enabled 2022-08-17 11:12:15 +01:00
InstMerge
InstNamer
InstSimplify [InstSimplify] Add another and(x,c) case where the mask is redundant (and in fact can constant fold away) 2022-08-16 12:25:50 +01: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 Revert "[Local] Allow creating callbr with duplicate successors" 2022-07-19 15:03:27 -07:00
LCSSA
LICM [Test] Mode test for pr56243 from LICM to LoopSimplifyCFG 2022-07-18 12:37:01 +07: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 [NFC] Switch a few uses of undef to poison as placeholders for unreachable code 2022-07-23 21:50:11 +01:00
LoopDistribute Autogen a couple of predicated SCEV tests 2022-02-11 13:56:35 -08:00
LoopFlatten [LoopFlatten] Fix crash if the inner loop trip count comes from a sext instruction. 2022-06-07 08:21:21 -07:00
LoopFusion Sinking or hoisting instructions between loops before fusion 2022-07-27 06:55:09 -04:00
LoopIdiom [LoopIdiom] Fix bailout for aliasing in memcpy transform. 2022-05-31 17:24:23 -07:00
LoopInstSimplify [LoopInstSimplify] Ignore users in unreachable blocks. PR55072 2022-04-25 17:35:28 +07:00
LoopInterchange [LoopInterchange][PR56275] Fix legality with negative dependence vectors 2022-08-03 19:59:01 -04:00
LoopLoadElim [NFC][LAA] Match-up type sizes for possible extensions, based on actual bit-size rather than rounded-up byte size. 2022-04-22 23:16:20 -07:00
LoopPredication [SimpleLoopUnswitch] Skip non-trivial unswitching of cold loops 2022-08-08 18:12:04 +00:00
LoopReroll
LoopRotate [IR] Don't treat callbr as indirect terminator 2022-07-18 09:32:08 +02:00
LoopSimplify [BasicBlockUtils] Do not move loop metadata if outer loop header. 2022-05-23 16:39:54 -07:00
LoopSimplifyCFG [LoopSimplifyCFG] Prevent use-def dominance breach by handling dead exits. PR56243 2022-07-19 15:54:12 +07:00
LoopStrengthReduce [NFC] Switch a few uses of undef to poison as placeholders for unreachable code 2022-07-23 21:50:11 +01:00
LoopTransformWarning
LoopUnroll Return "[SCEV] Use context to strengthen flags of BinOps" 2022-08-16 14:12:36 +07:00
LoopUnrollAndJam
LoopVectorize [LV] Use variables instead of hard-coded metadata IDs in tests. 2022-08-16 12:21:49 +01:00
LoopVersioning
LoopVersioningLICM
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 dot product with varied strides 2022-08-11 19:09:21 +01: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 tests: add attributes that would normally come from inferattrs 2022-07-25 17:29:00 -04:00
MergeFunc [NFC] Switch a few uses of undef to poison as placeholders for unreachble code 2022-07-03 14:34:03 +01:00
MergeICmps Reapply [MergeICmps] Don't require GEP 2022-03-04 11:39:11 +01:00
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 MemoryBuiltins: remove malloc-family funcs from list 2022-07-25 17:29:01 -04:00
ObjCARC [Intrinsics] Add `nocallback` to the memset/cpy/move intrinsics 2022-07-21 22:52:46 -05:00
OpenMP Revert "[OpenMP] Remove noinline attributes in the device runtime" 2022-07-27 11:09:18 -04:00
PGOProfile [InstrProf] Add the skipprofile attribute 2022-08-04 08:45:27 -07:00
PartialInlining
PartiallyInlineLibCalls [PartiallyInlineLibCalls] Don't partially inline a musttail libcall. 2022-04-05 22:30:50 +03:00
PhaseOrdering [ValueTracking] computeKnownBits - attempt to use a branch condition feeding a phi to improve known bits range (PR38280) 2022-08-16 16:54:44 +01:00
PlaceSafepoints
PreISelIntrinsicLowering
PruneEH
Reassociate [Reassociate] Enable FP reassociation via 'reassoc' and 'nsz' 2022-07-15 11:44:35 -07: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] Don't check for UndefValue before calling markConstant() 2022-07-14 10:05:56 +02:00
SLPVectorizer [SLP]Fix PR51320: Try to vectorize single store operands. 2022-08-16 07:25:21 -07:00
SROA [SROA] Try harder to find a vector promotion viable type when rewriting 2022-08-08 11:04:01 -07:00
SafeStack [safestack] Support safestack in stack size diagnostics 2022-04-20 18:29:40 +00:00
SampleProfile [test] Change test/SampleProfile to use opaque pointers 2022-07-17 17:38:35 -07:00
ScalarizeMaskedMemIntrin
Scalarizer [NFC] Switch a few uses of undef to poison as placeholders for unreachble code 2022-06-30 21:47:31 +01:00
SeparateConstOffsetFromGEP [AArch64] Move SeparateConstOffsetFromGEPPass before LSR and enable EnableGEPOpt by default. 2022-07-22 15:20:53 +01:00
SimpleLoopUnswitch [SimpleLoopUnswitch] Skip non-trivial unswitching of cold loops 2022-08-08 18:12:04 +00:00
SimplifyCFG [SimplifyCFG] teach simplifycfg not to introduce ptrtoint for NI pointers 2022-08-15 15:11:48 -04:00
Sink [Sink] Don't sink non-willreturn calls (PR51188) 2022-04-07 16:35:05 +02:00
SpeculativeExecution
StraightLineStrengthReduce [CodeGen] Remove unneeded regex escaping in FileCheck patterns. NFC. 2022-02-18 16:10:56 +00:00
StripDeadPrototypes
StripSymbols
StructurizeCFG Revert "[StructurizeCFG] Improve basic block ordering" 2022-07-14 09:40:51 -05:00
SyntheticCountsPropagation
TailCallElim [NFC] Switch a few uses of undef to poison as placeholders for unreachble code 2022-07-03 14:34:03 +01:00
ThinLTOBitcodeWriter
TypePromotion [TypePromotion] Don't promote PHI + ZExt if wider than RegisterBitWidth 2022-08-17 09:54:15 +01:00
UnifyFunctionExitNodes
UnifyLoopExits Revert "[UnifyLoopExits] Reduce number of guard blocks" 2022-07-14 10:33:52 -05:00
Util [FlattenCFG] avoid crash on malformed code 2022-08-16 15:11:00 -04: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