Skip to content

Conversation

@z1-cciauto
Copy link
Collaborator

No description provided.

c8ef and others added 19 commits November 8, 2025 20:39
This patch adds 4 macros in the `netinet/in.h` header, as specified by
POSIX standards.
Previously, SimplifyCFG only simplified unconditional branches when they
met a pattern (`swicth` -> `icmp` -> `br` -> `phi`) as follows:
```LLVM
   switch i8 %A, label %DEFAULT [ i8 1, label %end    i8 2, label %end ]
DEFAULT:
   %tmp = icmp eq i8 %A, 92
   br label %end
end:
   ... = phi i1 [ true, %entry ], [ %tmp, %DEFAULT ], [ true, %entry ]
```

This PR supports a new and more generic pattern (`switch` -> `icmp` ->
`select` -> `br` -> `phi` ) to simplify unconditional branches as
follows:
```LLVM
; BEFORE
case1:
  switch i32 %x, label %DEFAULT [ 
    i32 0, label %end    
    i32 1, label %case2 
  ]
case2:
  br label %end
DEFAULT:
  %tmp = icmp eq i32 %x, 2
  %val = select i1 %tmp, i32 V3, i32 V4
  br label %end
end:
  ... = phi i32 [ V1, %case1 ], [ V2, %case2 ], [ %val, %DEFAULT ]
```

We prefer to split the edge to 'end' so that there are TWO entries of
V3/V4 to the PHI, merging the icmp & select into the switch, as follows:
```LLVM
; AFTER
case1:
  switch i32 %x, label %DEFAULT [
    i32 0, label %end
    i32 1, label %case2
    i32 2, label %case3
  ]
case2:
  br label %end
case3:
  br label %end
DEFAULT:
  br label %end
end:
  ... = phi i32 [ V1, %case1 ], [ V2, %case2 ], [ V3, %case3 ], [ V4, %DEFAULT]
```

Alive2 Proof: https://alive2.llvm.org/ce/z/jYHM4f
Promising Optimization Impact:
dtcxzyw/llvm-opt-benchmark#3006
)

Fix AArch64 argument passing for C++ empty classes with large explicitly specified  alignment

reproducer: https://godbolt.org/z/qsze8fqra 
rel issue: llvm#69872 
rel commit: llvm@1711cc9
Identified with bugprone-unused-local-non-trivial-variable.
Identified with bugprone-unused-local-non-trivial-variable.
Identified with bugprone-unused-local-non-trivial-variable.
Identified with bugprone-unused-local-non-trivial-variable.
This patch is limited to single-word replacements to fix spelling
and/or grammar to ease the review process.  Punctuation and markdown
fixes are specifically excluded.
@z1-cciauto z1-cciauto requested a review from a team November 8, 2025 17:06
@z1-cciauto
Copy link
Collaborator Author

@ronlieb ronlieb removed the request for review from nicolasvasilache November 8, 2025 17:10
@z1-cciauto z1-cciauto merged commit c500c6a into amd-staging Nov 8, 2025
9 checks passed
@z1-cciauto z1-cciauto deleted the upstream_merge_202511081206 branch November 8, 2025 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants