[PATCH] D139275: [SimplifyCFG] `FoldBranchToCommonDest()`: deal with mismatched IV's in PHI's in common successor block
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 6 15:11:03 PST 2022
arsenm added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:3575
+};
+struct SelectCache {
+ using UniqueSelectIndex = unsigned;
----------------
Comment what a SelectCache is?
================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:3740
+ &PhiRecipe = std::get<1>(I);
+
+ Value **MaterializedSelect;
----------------
Comment what this is trying to do
================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:3742-3743
+ Value **MaterializedSelect;
+ if (std::holds_alternative<CompatibleIncomingValue>(PhiRecipe)) {
+ MaterializedSelect = &std::get<CompatibleIncomingValue>(PhiRecipe).V;
+ } else {
----------------
std::get_if?
================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:3754-3755
+ SelRecipe.FalseVal, PN.getName() + ".sel");
+ if (isa<Instruction>(*MaterializedSelect))
+ RemapInstruction(cast<Instruction>(*MaterializedSelect), VMap,
+ RF_NoModuleLevelChanges | RF_IgnoreMissingLocals);
----------------
dyn_cast instead of isa + cast
================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:3887
+ ++NumSelectsNeeded;
+ SawVectorSelect |= PN.getType()->isVectorTy();
+ }
----------------
I'm not really sure what this is doing; should there be a vector variant of the fpclassify test?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139275/new/
https://reviews.llvm.org/D139275
More information about the llvm-commits
mailing list