[PATCH] D77624: [PowerPC] Update alignment for RLI in LowerFP_TO_INTForReuse
Kai Luo via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 6 19:38:44 PDT 2020
lkail created this revision.
lkail added reviewers: PowerPC, jsji, nemanjai, steven.zhang.
Herald added subscribers: llvm-commits, shchenz, kbarton, hiraditya.
Herald added a project: LLVM.
In LowerFP_TO_INTForReuse, when emitting `stfiwx`, alignment of 4 is
set for the `MachineMemOperand`, but RLI's alignment is not updated
for following loads.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D77624
Files:
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/test/CodeGen/PowerPC/kernel-fp-round.ll
Index: llvm/test/CodeGen/PowerPC/kernel-fp-round.ll
===================================================================
--- llvm/test/CodeGen/PowerPC/kernel-fp-round.ll
+++ llvm/test/CodeGen/PowerPC/kernel-fp-round.ll
@@ -6,7 +6,7 @@
; CHECK-NEXT: - { id: 0, size: 4, alignment: 4 }
; CHECK: %2:f8rc = FCTIWZ killed %1, implicit $rm
; CHECK: STFIWX killed %2, $zero8, %3
-; CHECK-NEXT: %4:f8rc = LFIWAX $zero8, %3 :: (load 4 from %stack.0, align 1)
+; CHECK-NEXT: %4:f8rc = LFIWAX $zero8, %3 :: (load 4 from %stack.0)
entry:
%b = fptosi float %a to i32
%c = sitofp i32 %b to float
Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
===================================================================
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -7919,10 +7919,12 @@
// Emit a store to the stack slot.
SDValue Chain;
+ Align Alignment;
if (i32Stack) {
MachineFunction &MF = DAG.getMachineFunction();
MachineMemOperand *MMO =
MF.getMachineMemOperand(MPI, MachineMemOperand::MOStore, 4, Align(4));
+ Alignment = Align(4);
SDValue Ops[] = { DAG.getEntryNode(), Tmp, FIPtr };
Chain = DAG.getMemIntrinsicNode(PPCISD::STFIWX, dl,
DAG.getVTList(MVT::Other), Ops, MVT::i32, MMO);
@@ -7940,6 +7942,7 @@
RLI.Chain = Chain;
RLI.Ptr = FIPtr;
RLI.MPI = MPI;
+ RLI.Alignment = Alignment;
}
/// Custom lowers floating point to integer conversions to use
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77624.255570.patch
Type: text/x-patch
Size: 1495 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200407/441efbe7/attachment.bin>
More information about the llvm-commits
mailing list