This removes a bunch of duplicated code, by adding an intermediate
function simplifyReduction that takes a std::function argument
for the actual replacement of the code.
No functional change intended.
| Paths 
 |  Differential  D132588  
[FLANG][NFCI]De-duplicate code in SimplifyIntrinsics ClosedPublic Authored by Leporacanthicus on Aug 24 2022, 12:13 PM. 
Details Summary This removes a bunch of duplicated code, by adding an intermediate No functional change intended. 
Diff Detail 
 Event TimelineHerald added projects: Restricted Project, Restricted Project.  ·  View Herald TranscriptAug 24 2022, 12:13 PM Leporacanthicus added reviewers: vzakhari, kiranchandramohan, clementval, awarzynski, DylanFleming-arm.Aug 25 2022, 6:16 AM 
 Leporacanthicus marked 2 inline comments as done.Comment Actions Updates per review comments: 
 Comment Actions Thanks for function_ref replacements! 
 
 
 Leporacanthicus added inline comments. 
 This revision is now accepted and ready to land.Sep 1 2022, 8:14 AM Closed by commit rG43159b5808a7: [FLANG][NFCI]De-duplicate code in SimplifyIntrinsics (authored by MatsPetersson).  ·  Explain WhySep 2 2022, 2:50 AM This revision was automatically updated to reflect the committed changes. 
Revision Contents 
 
 
Diff 457062 flang/lib/Optimizer/Transforms/SimplifyIntrinsics.cpp
 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I was recently told that we do not usually use std::function. The advice was to replace it with function_ref: https://reviews.llvm.org/D129810#inline-1277689