[PATCH] D155138: Revert "[ARM] Correctly handle execute-only in EmitStructByval"

Caslyn Tonelli via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 16:30:00 PDT 2023


Caslyn created this revision.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
Caslyn requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This reverts commit 210f61cbddeddac47b347db072d674ee142520f6 <https://reviews.llvm.org/rG210f61cbddeddac47b347db072d674ee142520f6>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155138

Files:
  llvm/lib/Target/ARM/ARMISelLowering.cpp


Index: llvm/lib/Target/ARM/ARMISelLowering.cpp
===================================================================
--- llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -11513,12 +11513,18 @@
   // Load an immediate to varEnd.
   Register varEnd = MRI.createVirtualRegister(TRC);
   if (Subtarget->useMovt()) {
-    BuildMI(BB, dl, TII->get(IsThumb ? ARM::t2MOVi32imm : ARM::MOVi32imm),
-            varEnd)
-        .addImm(LoopSize);
-  } else if (Subtarget->genExecuteOnly()) {
-    assert(IsThumb && "Non-thumb expected to have used movt");
-    BuildMI(BB, dl, TII->get(ARM::tMOVi32imm), varEnd).addImm(LoopSize);
+    unsigned Vtmp = varEnd;
+    if ((LoopSize & 0xFFFF0000) != 0)
+      Vtmp = MRI.createVirtualRegister(TRC);
+    BuildMI(BB, dl, TII->get(IsThumb ? ARM::t2MOVi16 : ARM::MOVi16), Vtmp)
+        .addImm(LoopSize & 0xFFFF)
+        .add(predOps(ARMCC::AL));
+
+    if ((LoopSize & 0xFFFF0000) != 0)
+      BuildMI(BB, dl, TII->get(IsThumb ? ARM::t2MOVTi16 : ARM::MOVTi16), varEnd)
+          .addReg(Vtmp)
+          .addImm(LoopSize >> 16)
+          .add(predOps(ARMCC::AL));
   } else {
     MachineConstantPool *ConstantPool = MF->getConstantPool();
     Type *Int32Ty = Type::getInt32Ty(MF->getFunction().getContext());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155138.539791.patch
Type: text/x-patch
Size: 1284 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230712/b08f5ee4/attachment.bin>


More information about the llvm-commits mailing list