================
@@ -1830,6 +1797,28 @@ unsigned SystemZInstrInfo::getInstSizeInBytes(const 
MachineInstr &MI) const {
     return 18;
   if (MI.getOpcode() == TargetOpcode::PATCHABLE_RET)
     return 18 + (MI.getOperand(0).getImm() == SystemZ::CondReturn ? 4 : 0);
+  if ((MI.getOpcode() == SystemZ::MOVE_STACK_GUARD) ||
+      (MI.getOpcode() == SystemZ::COMPARE_STACK_GUARD))
+    return 6;
+  if ((MI.getOpcode() == SystemZ::LOAD_STACK_GUARD_ADDRESS) ||
+      (MI.getOpcode() == TargetOpcode::LOAD_STACK_GUARD)) {
+    StringRef GuardType = MI.getParent()
+                              ->getParent()
+                              ->getFunction()
+                              .getParent()
+                              ->getStackProtectorGuard();
+    unsigned Size = (MI.getOpcode() == TargetOpcode::LOAD_STACK_GUARD)
+                        ? 6
+                        : 0; // lg to load value
+    if (GuardType == "global")
----------------
dominik-steenken wrote:

Ah, this is a case of `clang-format` introducing line breaks that change the 
perceived meaning of a comment. The comment was meant for the whole statement. 
Basically, the size of `LOAD_STACK_GUARD[_ADDRESS]` is computed by the size 
required for loading the stack guard's address (this depends on the guard's 
type), and then we need to either add `6` for the `lg` in case of 
`LOAD_STACK_GUARD`, or nothing in case of `LOAD_STACK_GUARD_ADDRESS`.

I'll move the comment one line up, that should make that clear.

https://github.com/llvm/llvm-project/pull/169317
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to