interp: improve scan for loads
During a scan, consider loads from dirty globals to be dirty and check whether they have any local side effects. This fixes a problem with the new volatile operations that are now in methods on registers instead of being emitted inline as volatile instructions.
Этот коммит содержится в:
родитель
f94af9f61e
коммит
5342d392aa
1 изменённых файлов: 10 добавлений и 1 удалений
|
@ -109,7 +109,16 @@ func (e *Eval) hasSideEffects(fn llvm.Value) *sideEffectResult {
|
||||||
default:
|
default:
|
||||||
panic("unreachable")
|
panic("unreachable")
|
||||||
}
|
}
|
||||||
case llvm.Load, llvm.Store:
|
case llvm.Load:
|
||||||
|
if inst.IsVolatile() {
|
||||||
|
result.updateSeverity(sideEffectLimited)
|
||||||
|
}
|
||||||
|
if _, ok := e.dirtyGlobals[inst.Operand(0)]; ok {
|
||||||
|
if e.hasLocalSideEffects(dirtyLocals, inst) {
|
||||||
|
result.updateSeverity(sideEffectLimited)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case llvm.Store:
|
||||||
if inst.IsVolatile() {
|
if inst.IsVolatile() {
|
||||||
result.updateSeverity(sideEffectLimited)
|
result.updateSeverity(sideEffectLimited)
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче