[VPlan] Unify Value2VPValue and VPExternalDefs maps (NFCI).
authorFlorian Hahn <flo@fhahn.com>
Sun, 16 Apr 2023 14:38:31 +0000 (15:38 +0100)
committerFlorian Hahn <flo@fhahn.com>
Sun, 16 Apr 2023 14:38:31 +0000 (15:38 +0100)
commit668045eb77628be13e448ffbb855473ffca1cc43
tree8caffbf8aa5bac27965c94f468c49af87a9761a2
parent2832d7941f4207f1fcf813b27cf08cecc3086959
[VPlan] Unify Value2VPValue and VPExternalDefs maps (NFCI).

Before this patch, a VPlan contained 2 mappings for Values -> VPValue:
1) Value2VPValue and 2) VPExternalDefs.

This duplication is unnecessary and there are already cases where
external defs are added to Value2VPValue. This patch replaces all uses
of VPExternalDefs with Value2VPValue.

It clarifies the naming of getOrAddVPValue (to getOrAddExternalVPValue)
and addVPValue (to addExternalVPValue).

At the moment, this is NFC, but will enable additional simplifications
in D147783.

Depends on D147891.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D147892
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/lib/Transforms/Vectorize/VPlan.cpp
llvm/lib/Transforms/Vectorize/VPlan.h
llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp
llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp
llvm/unittests/Transforms/Vectorize/VPlanTest.cpp