| 3961 | } |
| 3962 | |
| 3963 | void compileAtomicCheckOffsetAlignment(LLVM::Value Offset, |
| 3964 | LLVM::Type IntType) noexcept { |
| 3965 | const auto BitWidth = IntType.getIntegerBitWidth(); |
| 3966 | auto BWMask = LLContext.getInt64((BitWidth >> 3) - 1); |
| 3967 | auto Value = Builder.createAnd(Offset, BWMask); |
| 3968 | auto OkBB = LLVM::BasicBlock::create(LLContext, F.Fn, "address_align_ok"); |
| 3969 | auto IsAddressAligned = Builder.createLikely( |
| 3970 | Builder.createICmpEQ(Value, LLContext.getInt64(0))); |
| 3971 | Builder.createCondBr(IsAddressAligned, OkBB, |
| 3972 | getTrapBB(ErrCode::Value::UnalignedAtomicAccess)); |
| 3973 | |
| 3974 | Builder.positionAtEnd(OkBB); |
| 3975 | } |
| 3976 | |
| 3977 | void compileMemoryFence() noexcept { |
| 3978 | Builder.createFence(LLVMAtomicOrderingSequentiallyConsistent); |
nothing calls this directly
no test coverage detected