Refactor EventFactory, Compilers and Parsers#1009
Conversation
|
@xeren can you please rebase and fix the conflicts? |
…actory # Conflicts: # dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLitmusAArch64.java # dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLitmusC.java # dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLitmusPPC.java # dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLitmusPTX.java # dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLitmusRISCV.java # dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLitmusVulkan.java # dartagnan/src/main/java/com/dat3m/dartagnan/parsers/program/visitors/VisitorLitmusX86.java # dartagnan/src/test/java/com/dat3m/dartagnan/others/miscellaneous/AnalysisTest.java
hernanponcedeleon
left a comment
There was a problem hiding this comment.
Why are you adding newRMWLoadExclusive for each arch if they all end up calling the general case? While I could see an argument in the factory for having the method for each arch, we do have other "common" events that use a single method, e.g. newRMWStoreExclusiveWithMo
| AArch64.DSB.newISHLDBarrier() : | ||
| null; | ||
| Event fence = switch (e.getMo()) { | ||
| case Tag.C11.MO_RELEASE, Tag.C11.MO_SC -> AArch64.newDmbIshBarrier(); |
There was a problem hiding this comment.
You are missing the mo.equals(C11.MO_ACQUIRE_RELEASE) case
I agree with you but maybe from a different point of view. I think it becomes more and more unclear of whether a (*) It is fine to generate core events from the parser, but not if you intend to support compilation to other targets on those events (at least in our current architecture). |
|
With the different |
Mostly cleans up some imports, but also
ProgramBuilder.addChildin litmus parsers.FenceNameRepositoryintoEventFactoryModifications to
EventFactoryAdded
AArch64.newRMWLoadExclusive,AArch64.newRMWStoreExclusiveX86.newLoadFence,newStoreFence(still not implemented, but merges two places)RISCV.newRMWLoadExclusivePower.newRMWLoadExclusiveModified
newRMWStoreExclusive,newRMWStoreExclusiveWithMoAArch64.newDmbBarrier, etc.AArch64.newBarrier(String,String)(moved fromnewFenceOpt)RISCV.newRMWStoreConditional