[PATCH] D116877: [GlobalISel] Add big endian support in CallLowering
Sheng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 13 17:12:22 PST 2022
0x59616e updated this revision to Diff 399845.
0x59616e retitled this revision from "[GlobalISel] Fix a big-endian-related bug in CallLowering" to "[GlobalISel] Add big endian support in CallLowering".
0x59616e added a comment.
update diff.
Remove a test in this revision, since that test depends on the InstructionSelector of M68k and I defer that part.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116877/new/
https://reviews.llvm.org/D116877
Files:
llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
llvm/test/CodeGen/M68k/GlobalISel/irtranslator-ret.ll
Index: llvm/test/CodeGen/M68k/GlobalISel/irtranslator-ret.ll
===================================================================
--- llvm/test/CodeGen/M68k/GlobalISel/irtranslator-ret.ll
+++ llvm/test/CodeGen/M68k/GlobalISel/irtranslator-ret.ll
@@ -206,8 +206,8 @@
; CHECK: [[G_LOAD2:%[0-9]+]]:_(s32) = G_LOAD [[G_F_I2]](p0)
; CHECK: [[G_MERGE_VAL:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[G_LOAD1]](s32), [[G_LOAD2]](s32)
; CHECK: [[G_UNMERGE_VAL1:%[0-9]+]]:_(s32), [[G_UNMERGE_VAL2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[G_MERGE_VAL]](s64)
- ; CHECK: $d0 = COPY [[G_UNMERGE_VAL1]](s32)
- ; CHECK: $d1 = COPY [[G_UNMERGE_VAL2]](s32)
- ; CHECK: RTS implicit $d0, implicit $d1
+ ; CHECK: $d1 = COPY [[G_UNMERGE_VAL1]](s32)
+ ; CHECK: $d0 = COPY [[G_UNMERGE_VAL2]](s32)
+ ; CHECK: RTS implicit $d1, implicit $d0
ret i64 %a
}
Index: llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
===================================================================
--- llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
+++ llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
@@ -697,10 +697,12 @@
ValTy, extendOpFromFlags(Args[i].Flags[0]));
}
+ bool BigEndianPartOrdering = TLI->hasBigEndianPartOrdering(OrigVT, DL);
for (unsigned Part = 0; Part < NumParts; ++Part) {
Register ArgReg = Args[i].Regs[Part];
// There should be Regs.size() ArgLocs per argument.
- VA = ArgLocs[j + Part];
+ unsigned Idx = BigEndianPartOrdering ? NumParts - 1 - Part : Part;
+ CCValAssign &VA = ArgLocs[j + Idx];
const ISD::ArgFlagsTy Flags = Args[i].Flags[Part];
if (VA.isMemLoc() && !Flags.isByVal()) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116877.399845.patch
Type: text/x-patch
Size: 1664 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220114/60260c0a/attachment.bin>
More information about the llvm-commits
mailing list