llvm-project/llvm/lib/Transforms/Scalar
Warren Ristow 230c8c56f2 [Reassociate] Cleanup minor missed optimizations
In analyzing issue #56483, it was noticed that running `opt` with
`-reassociate` was missing some minor optimizations. For example,
there were cases where the running `opt` on IR with floating-point
instructions that have the `fast` flags applied, sometimes resulted in
less efficient code than the input IR (things like dead instructions
left behind, and missed reassociations). These were sometimes noted
in the test-files with TODOs, to investigate further. This commit
fixes some of these problems, removing some TODOs in the process.

FTR, I refer to these as "minor" missed optimizations, because when
running a full clang/llvm compilation, these inefficiencies are not
happening, as other passes clean that residue up. Regardless, having
cleaner IR produced by `opt`, makes assessing the quality of fixes done
in `opt` easier.
2022-07-14 08:21:04 -07:00
..
ADCE.cpp Cleanup includes: Transform/Scalar 2022-03-03 07:56:34 +01:00
AlignmentFromAssumptions.cpp Cleanup includes: Transform/Scalar 2022-03-03 07:56:34 +01:00
AnnotationRemarks.cpp Cleanup includes: Transform/Scalar 2022-03-03 07:56:34 +01:00
BDCE.cpp
CMakeLists.txt [Passes] Remove legacy LoopUnswitch pass. 2022-04-29 10:30:49 +01:00
CallSiteSplitting.cpp [Scalar][NFC] Minor cleanups in CallSiteSplitting.cpp 2022-05-06 23:03:49 +00:00
ConstantHoisting.cpp [llvm] Use value instead of getValue (NFC) 2022-07-13 23:11:56 -07:00
ConstraintElimination.cpp Recommit "[ConstraintElimination] Transfer info from ULT to signed system." 2022-06-24 09:27:14 +02:00
CorrelatedValuePropagation.cpp [NFC] Switch a few uses of undef to poison as placeholders for unreachble code 2022-06-30 23:01:43 +01:00
DCE.cpp
DFAJumpThreading.cpp [NFC] Switch a few uses of undef to poison as placeholders for unreachble code 2022-07-03 14:34:03 +01:00
DeadStoreElimination.cpp [MemoryBuiltins] Accept any value in getInitialValueOfAllocation() (NFC) 2022-06-24 16:08:07 +02:00
DivRemPairs.cpp
EarlyCSE.cpp [NFC] format InstructionSimplify & lowerCaseFunctionNames 2022-06-09 16:10:08 +02:00
FlattenCFGPass.cpp Cleanup includes: Transform/Scalar 2022-03-03 07:56:34 +01:00
Float2Int.cpp [iwyu] Fix some header include regression 2022-04-05 15:02:03 +02:00
GVN.cpp [llvm] Use value instead of getValue (NFC) 2022-07-13 23:11:56 -07:00
GVNHoist.cpp [GVNHoist] drop debug location according to the debug info guide 2022-03-30 20:17:53 -07:00
GVNSink.cpp Use llvm::less_second (NFC) 2022-06-04 22:48:32 -07:00
GuardWidening.cpp [GuardWidening] Fix a nasty cast bug in c2eccc6 2022-06-07 13:27:13 -07:00
IVUsersPrinter.cpp Cleanup includes: Transform/Scalar 2022-03-03 07:56:34 +01:00
IndVarSimplify.cpp [SCEVExpander] Make CanonicalMode handing in isSafeToExpand() more robust (PR50506) 2022-07-14 14:41:51 +02:00
InductiveRangeCheckElimination.cpp [SCEVExpander] Make CanonicalMode handing in isSafeToExpand() more robust (PR50506) 2022-07-14 14:41:51 +02:00
InferAddressSpaces.cpp [NFC][Alignment] Simplify code 2022-06-10 15:25:28 +00:00
InstSimplifyPass.cpp [NFC] format InstructionSimplify & lowerCaseFunctionNames 2022-06-09 16:10:08 +02:00
JumpThreading.cpp [JumpThreading] Avoid threadThroughTwoBasicBlocks when PredPred BB ends with indirectbranch 2022-07-08 09:29:17 +02:00
LICM.cpp [BasicBlockUtils] Allow splitting predecessors with callbr terminators 2022-07-07 09:13:25 +02:00
LoopAccessAnalysisPrinter.cpp Cleanup includes: Transform/Scalar 2022-03-03 07:56:34 +01:00
LoopBoundSplit.cpp Cleanup includes: DebugInfo & CodeGen 2022-03-12 17:26:40 +01:00
LoopDataPrefetch.cpp [SCEVExpander] Make CanonicalMode handing in isSafeToExpand() more robust (PR50506) 2022-07-14 14:41:51 +02:00
LoopDeletion.cpp [NFC] Switch a few uses of undef to poison as placeholders for unreachble code 2022-06-30 21:47:31 +01:00
LoopDistribute.cpp [llvm] Use value instead of getValue (NFC) 2022-07-13 23:11:56 -07:00
LoopFlatten.cpp Don't use Optional::hasValue (NFC) 2022-06-20 20:17:57 -07:00
LoopFuse.cpp Remove unneeded cl::ZeroOrMore for cl::opt/cl::list options 2022-06-05 01:07:51 -07:00
LoopIdiomRecognize.cpp [SCEVExpander] Make CanonicalMode handing in isSafeToExpand() more robust (PR50506) 2022-07-14 14:41:51 +02:00
LoopInstSimplify.cpp Don't use Optional::hasValue (NFC) 2022-06-20 20:17:57 -07:00
LoopInterchange.cpp [LoopInterchange] New cost model for loop interchange 2022-06-28 00:08:37 -04:00
LoopLoadElimination.cpp [CompileTime] [Passes] Avoid computing unnecessary analyses. NFC 2022-04-29 10:00:06 -04:00
LoopPassManager.cpp Revert "[PassManager] Add pretty stack entries before P->run() call." 2022-03-09 18:46:32 +00:00
LoopPredication.cpp [LoopPredication] Use isSafeToExpandAt() member function (NFC) 2022-07-14 14:49:07 +02:00
LoopRerollPass.cpp Cleanup includes: Transform/Scalar 2022-03-03 07:56:34 +01:00
LoopRotation.cpp [llvm] Don't use Optional::hasValue (NFC) 2022-06-26 18:31:51 -07:00
LoopSimplifyCFG.cpp [llvm] Don't use Optional::hasValue (NFC) 2022-06-26 18:31:51 -07:00
LoopSink.cpp [LICM] Pass MemorySSAUpdater by referene (NFC) 2022-04-08 10:08:57 +02:00
LoopStrengthReduce.cpp [SCEVExpander] Make CanonicalMode handing in isSafeToExpand() more robust (PR50506) 2022-07-14 14:41:51 +02:00
LoopUnrollAndJamPass.cpp [llvm] Use value instead of getValue (NFC) 2022-07-13 23:11:56 -07:00
LoopUnrollPass.cpp [llvm] Use value instead of getValue (NFC) 2022-07-13 23:11:56 -07:00
LoopVersioningLICM.cpp Cleanup includes: Transform/Scalar 2022-03-03 07:56:34 +01:00
LowerAtomicPass.cpp Transforms: Split LowerAtomics into separate Utils and pass 2022-04-06 20:54:45 -04:00
LowerConstantIntrinsics.cpp [llvm] Don't use Optional::hasValue (NFC) 2022-06-26 18:31:51 -07:00
LowerExpectIntrinsic.cpp [misexpect] Re-implement MisExpect Diagnostics 2022-04-19 21:23:48 +00:00
LowerGuardIntrinsic.cpp Check users of instrinsics instead of traversing entire function.NFC 2022-04-13 12:28:51 -04:00
LowerMatrixIntrinsics.cpp [LowerMatrixMultiplication] Switch dummy values from undef to poison [NFC] 2022-07-03 12:32:19 +01:00
LowerWidenableCondition.cpp Check users of instrinsics instead of traversing entire function.NFC 2022-04-13 12:28:51 -04:00
MakeGuardsExplicit.cpp Cleanup includes: Transform/Scalar 2022-03-03 07:56:34 +01:00
MemCpyOptimizer.cpp [Alignment] Replace commonAlignment with std::min 2022-06-28 07:15:02 +00:00
MergeICmps.cpp Reapply [MergeICmps] Don't require GEP 2022-03-04 11:39:11 +01:00
MergedLoadStoreMotion.cpp Cleanup includes: Transform/Scalar 2022-03-03 07:56:34 +01:00
NaryReassociate.cpp [NARY-REASSOCIATE][NFC] Simplify min/max handling 2021-10-21 15:45:53 +07:00
NewGVN.cpp [VNCoercion] Use ConstantFoldLoadFromConst API (NFCI) 2022-06-30 14:52:27 +02:00
PartiallyInlineLibCalls.cpp Don't use Optional::hasValue (NFC) 2022-06-20 20:17:57 -07:00
PlaceSafepoints.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
Reassociate.cpp [Reassociate] Cleanup minor missed optimizations 2022-07-14 08:21:04 -07:00
Reg2Mem.cpp Cleanup includes: Transform/Scalar 2022-03-03 07:56:34 +01:00
RewriteStatepointsForGC.cpp [RS4GC] Handle freeze case for vector 2022-06-23 11:58:41 +07:00
SCCP.cpp [SCCP] Simplify CFG in SCCP as well 2022-06-30 09:25:03 +02:00
SROA.cpp [SROA] Don't create constant expressions (NFC) 2022-06-29 11:51:22 +02:00
Scalar.cpp [Passes] Remove legacy LoopUnswitch pass. 2022-04-29 10:30:49 +01:00
ScalarizeMaskedMemIntrin.cpp Don't use Optional::hasValue (NFC) 2022-06-20 20:17:57 -07:00
Scalarizer.cpp [NFC] Switch a few uses of undef to poison as placeholders for unreachble code 2022-06-30 21:47:31 +01:00
SeparateConstOffsetFromGEP.cpp [SeparateConstOffsetFromGEP] Remove TargetMachine.h include. NFC 2022-02-25 21:40:00 -08:00
SimpleLoopUnswitch.cpp [NFC] Switch a few uses of undef to poison as placeholders for unreachble code 2022-06-30 21:47:31 +01:00
SimplifyCFGPass.cpp Cleanup includes: Transform/Scalar 2022-03-03 07:56:34 +01:00
Sink.cpp [Sink] Don't sink non-willreturn calls (PR51188) 2022-04-07 16:35:05 +02:00
SpeculativeExecution.cpp [NFC] Rename Instrinsic to Intrinsic 2022-04-25 18:13:23 +01:00
StraightLineStrengthReduce.cpp [IRBuilder] Add IsInBounds parameter to CreateGEP() 2022-05-13 14:30:55 +02:00
StructurizeCFG.cpp Revert "[StructurizeCFG] Improve basic block ordering" 2022-07-14 09:40:51 -05:00
TLSVariableHoist.cpp Correct spelling error in TLS-Load-Hoist 2022-04-04 08:27:54 +08:00
TailRecursionElimination.cpp [NFC] Switch a few uses of undef to poison as placeholders for unreachble code 2022-07-03 14:34:03 +01:00
WarnMissedTransforms.cpp [llvm] Use value_or instead of getValueOr (NFC) 2022-06-18 23:07:11 -07:00