[PATCH] D129016: [PowerPC] implemented @llvm.ppc.kill.canary to corrupt stack guard

Kai Nacke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 5 12:04:58 PDT 2022


Kai added a comment.

Some more nits, otherwise LGTM.



================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:11150
+
+    const uint64_t XORWord = 0xFFFFFFFFFFFFFFFF; // XORing with 0b111...111 will never
+                                         // result in the original word
----------------
Line too long.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:11157
+                          : M->getNamedValue("__stack_chk_guard");
+			  */
+    if (useLoadStackGuardNode()) { // linux uses LOAD_STACK_GUARD node instead of having a
----------------
Please remove dead code.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:11158
+			  */
+    if (useLoadStackGuardNode()) { // linux uses LOAD_STACK_GUARD node instead of having a
+                                   // canary word global value
----------------
Line too long.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:11185
+      
+    } else if (Value *GV = getSDagStackGuard(*M)) { // on aix, load from global value
+      VT = DAG.getTargetLoweringInfo().getValueType(DAG.getDataLayout(),
----------------
Line too long.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:11188
+                                                    GV->getType(), true);
+      SDValue CanaryLoc = DAG.getGlobalAddress(dyn_cast<GlobalValue>(GV), DL, VT);
+
----------------
Line too long.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129016/new/

https://reviews.llvm.org/D129016



More information about the llvm-commits mailing list