You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix constant folding in PredefinedConstantResolving
PredefinedConstantResolving pass caused type mismatch assertion
in tests while moving to opaque pointers. It happened when there was a
type difference between a global variable and it's load instruction
user. With typed pointers the pass was skipped in this scenario because
user of same global was bitcast and then it's user was load. What this
pass tried to do was doing RAUW operation on load to replace it with
global constant. This fix changes pass's behaviour by enabling constant
folding even when there is a type difference between load instruction
and global constant.
Example crashing ir:
```llvm
@global = constant [3 x i64] [i64 16, i64 32, i64 64]
define void @func(i64 %0) {
%2 = load i64, ptr @global ; <-- crash
ret void
}
```
0 commit comments