Main reason is preparation to transform AliasResult to class that contains
offset for PartialAlias case.
Details
Diff Detail
- Repository
 - rG LLVM Github Monorepo
 
Event Timeline
This looks fine to me, though I'm not clear on how making it an enum class will help with moving to a class. Do you happen to have the patch for that already?
| llvm/include/llvm/Analysis/AliasAnalysis.h | ||
|---|---|---|
| 77 | This paragraph should be dropped.  | |
| llvm/lib/Target/Hexagon/HexagonStoreWidening.cpp | ||
| 183 | Could also write this as AA->isNoAlias(L, SL) (same in some following occurrences). No strong preference though.  | |
No, I don't have a patch at the moment, but will upload one since you're generally ok with this step.
I thought to convert the enum to a something like
class AliasResult {
public:
  int16_t Offset : 14;
  uint8_t EnumStorage : 2;
  ...
public:
  enum {...};
  ...
}So after that access to the enum values needs AliasResult:: and I decided to split this NFC part away.
And using scoped enum allowed to find all uses.
| llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp | ||
|---|---|---|
| 43–44 | Does it work with "using AliasResult;"?  | |
| llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp | ||
|---|---|---|
| 43–44 | No, using AliasResult::NoAlias; in a block will be available since C++20. At the moment I can place using AR = AliasResult; and then use AR:: but it will increase current table width of 120 to 138.  | |
| llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp | ||
|---|---|---|
| 43–44 | Then I can only think about defines before the block and undefs after.  | |
Made the enum unscoped back since it going to be unscoped within a class planned
to be new AliasResult.
Converted all AliasAnalysis::alias() == AliasResult::NoAlias to
AliasAnalysis::isNoAlias().
| llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp | ||
|---|---|---|
| 50–65 | Thanks, I am OK with this.  | |
This paragraph should be dropped.