-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Xtensa] Implement volatile load/store. #110292
Conversation
llvm/test/CodeGen/Xtensa/volatile.ll
Outdated
%0 = load volatile i8, ptr @x_i8, align 4 | ||
store volatile i8 %0, ptr @y_i8, align 4 | ||
%1 = load volatile i16, ptr @x_i16, align 4 | ||
store volatile i16 %1, ptr @y_i16, align 4 | ||
%2 = load volatile i32, ptr @x_i32, align 4 | ||
store volatile i32 %2, ptr @y_i32, align 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split each of these into its own test function?
Also test other types? i64, float, double, vectors, exotic types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for comment. I added tests with other types.
llvm/test/CodeGen/Xtensa/volatile.ll
Outdated
; CHECK-NEXT: ret | ||
|
||
entry: | ||
%0 = load volatile i8, ptr @x_i8, align 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Named values in tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
case Xtensa::L16UI: | ||
case Xtensa::L32I: { | ||
const MachineMemOperand &MMO = **MI.memoperands_begin(); | ||
if (MMO.isVolatile()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment why this is needed? It's also possible memory operands get lost during selection, should defend against missing MMO and assume volatile if it's missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added handling of the case when MMO is missing.
@@ -1104,10 +1104,24 @@ XtensaTargetLowering::emitSelectCC(MachineInstr &MI, | |||
MachineBasicBlock *XtensaTargetLowering::EmitInstrWithCustomInserter( | |||
MachineInstr &MI, MachineBasicBlock *MBB) const { | |||
DebugLoc DL = MI.getDebugLoc(); | |||
const TargetInstrInfo &TII = *Subtarget.getInstrInfo(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use XTensaInstrInfo. Also this might be a member already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added using XtensaInstrInfo. It is not a member yet, I'm not sure, whether we need to add it?
Add a memory wait "MEMW" instruction before volatile load/store operations, as implemented in GCC.
6bc11f4
to
1db96f6
Compare
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/73/builds/6535 Here is the relevant piece of the build log for the reference
|
Add a memory wait "MEMW" instruction before volatile load/store operations, as implemented in GCC.
Add a memory wait "MEMW" instruction before volatile load/store operations, as implemented in GCC.