[PATCH] D152328: InstrProf - don't emit 64 bit atomic operations on 32 bit platforms

Sean Mollet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 20 18:15:46 PDT 2023


SeanMollet added a comment.

In D152328#4436425 <https://reviews.llvm.org/D152328#4436425>, @ellis wrote:

> I still don't see how `DoCounterPromotion=true` emits atomics. As far as I can tell, all atomic instructions emitted in `InstrProfiling.cpp` are guarded behind an atomic flag that defaults to false.

I honestly couldn't figure it out either. If I change that to =false or comment that line out, they don't get emitted. Somehow AtomicCounterUpdatePromoted is getting set to true.

The offending emitter is InstrProfiling.cpp line 198:

  Builder.CreateAtomicRMW(AtomicRMWInst::Add, Addr, LiveInValue,
                          MaybeAlign(),
                          AtomicOrdering::SequentiallyConsistent);

I added the check around line 743 as well for sanity reasons.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152328/new/

https://reviews.llvm.org/D152328



More information about the llvm-commits mailing list