[llvm] [DFAJumpThreading] Add an early exit heuristic for unpredictable values (PR #85015)

via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 16 08:15:24 PDT 2024


XChy wrote:

To better explain the motivation of #85505, I construct an example. For code like:
```c
void a(int input) {
  for (int i = 0; i < 10000; i++) {
    switch (input) {
    case 0:
      input = 1;
    case 1:
      break;
    }
  }
  // we may look into things below...
  if (c) {
    if (c1) {
      //// many branches...
    } else {
      //// many branches...
    }
  } else {
    if (c2) {
      //// many branches...
    } else {
      //// many branches...
    }
  }
}
```
Current implementation may look into many irrelevant branches from loop exit, which have no impact on transforming the simple DFA.

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


More information about the llvm-commits mailing list