[PATCH] D141053: [SwiftError] Use IMPLICIT_DEF as a definition for unreachable VReg uses

Saleem Abdulrasool via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 5 10:05:28 PST 2023


compnerd added inline comments.


================
Comment at: llvm/lib/CodeGen/SwiftErrorValueTracking.cpp:259-261
+  for (auto UseIt = VRegUpwardsUse.begin(), End = VRegUpwardsUse.end();
+       UseIt != End; ++UseIt) {
+    const MachineBasicBlock *UseBB = UseIt->first.first;
----------------
I think that we can simplify this to:

```
for (const auto *Use : VRegUpwardsUse) {
  const MachineBasicBlock *UseBB = Use.first.first;
  Register VReg = Use.second;
```


================
Comment at: llvm/lib/CodeGen/SwiftErrorValueTracking.cpp:266
+
+    assert(std::find(RPOT.begin(), RPOT.end(), UseBB) == RPOT.end() &&
+           "Reachable block has VReg upward use without definition.");
----------------
Should this be an expensive assert?


================
Comment at: llvm/test/CodeGen/AArch64/swift-error-unreachable-use.ll:1
+; RUN: llc < %s
+;
----------------
Please expand this into three explicit invocations:

```
llc -mtriple aarch64-unknown-windows-msvc %s -filetype asm -o - | FileCheck %s
llc -mtriple aarch64-unknown-linux-gnu %s -filetype asm -o - | FileCheck %s
llc -mtriple aarch64-apple-macosx10.15 %s -filetype asm -o - | FileCheck %s
```

The test should actually validate that the output is correct.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141053/new/

https://reviews.llvm.org/D141053



More information about the llvm-commits mailing list