This has two benefits:
- we can now mark allocas that are used in atomic operations as safe
- this fixes a bug that would incorrectly mark all atomic writes as safe in HWASan instrumentation. this is because stack safety keeps a list of all *unsafe* operations that are reachable from an alloca, but it did not analyze atomic writes, so it would always mark them as safe.
maybe instead of introducing getNewValOperandIndex
just change RecordWrite(Value* operand) ?