[llvm] [MC] Fuse relaxation and layout into a single forward pass (PR #190318)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 7 17:47:10 PDT 2026


MaskRay wrote:

> huh, I'm having a hard time cherry-picking these patches to test them.
> 
> ```
> $ git remote add MaskRay https://github.com/MaskRay/llvm-project.git
> $ git fetch MaskRay pr/mc-relaxation
> $ git checkout MaskRay/pr/mc-relaxation
> 
> 
> $ git format-patch e4cc775aaadfc4c279c3d2c39f0203c8488fbf48 -1
> 0001-comment.patch
> $ git format-patch 286bc8e7bd57ff2631ac7691a95280272fcecad3 -1
> 0001-CIR-Fix-record-layout-for-no_unique_address-fields-1.patch
> ### ^ WHAT THAT'S THE WRONG COMMIT
> $ git format-patch f1d5f8a19654d0eb913fef4bbff9f676defcf89a -1
> 0001-MC-Fuse-relaxation-and-layout-into-a-single-forward-.patch
> 
> $ git format patch HEAD~2
> <prints 54 patch files>
> ```
> 
> what's going with this PR where I can't use `git format-patch` to grab `286bc8e7bd57ff2631ac7691a95280272fcecad3`? I've never seen this kind of failure before...

`pr/mc-relaxation` is a shadow branch created by https://github.com/MaskRay/pr-shadow that avoids force-push to work around github review limitation.

`286bc8e7bd57ff2631ac7691a95280272fcecad3` has updated the `main` baseline. 

```
  The shadow branch structure:
  * e4cc775 comment          ← latest sync (commit-tree snapshot)
  *   286bc8e comment        ← merge commit (rebase detected → merge with new base)
  |\
  | * dec90ff [CIR] ...      ← main branch commits (new merge-base)
  | * 271a08 [lldb] ...
  | * ...
```

```
  1. git format-patch 286bc8e -1 — 286bc8e is a merge commit, so format-patch skips it and falls through to the second parent dec90ff (the CIR commit). That's why he gets
  0001-CIR-Fix-record-layout-....
  2. git format-patch HEAD~2 prints 54 patches because HEAD~2 follows the first-parent chain past the merge, and the range includes all the main-branch commits brought in
  through the merge's second parent.
```

You can get the actual patch with
`git diff <merge-base>..FETCH_HEAD`

https://github.com/llvm/llvm-project/pull/190318


More information about the llvm-commits mailing list