[llvm] [GlobalIsel] Combine ADDO (PR #82927)

Thorsten Schütt via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 26 06:46:10 PST 2024


================
@@ -6918,3 +6920,200 @@ bool CombinerHelper::matchOr(MachineInstr &MI, BuildFnTy &MatchInfo) {
 
   return false;
 }
+
+bool CombinerHelper::matchAddOverflow(MachineInstr &MI, BuildFnTy &MatchInfo) {
+  GAddCarryOut *Add = cast<GAddCarryOut>(&MI);
----------------
tschuett wrote:

Replacing this line with:
```
GAddSubCarryOut *Add = cast<GAddSubCarryOut>(&MI);
```
seems dangerous and defeats the purpose of the assert in the `cast` .

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


More information about the llvm-commits mailing list