[PATCH] D64561: Add address-space mangling for stack related intrinsics

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 11 06:14:36 PDT 2019


arsenm added a comment.

There also need to be some codegen changes. SelectionDAG uses the wrong pointer type as well when lowering



================
Comment at: lib/CodeGen/SjLjEHPrepare.cpp:481
+  FrameAddrFn = Intrinsic::getDeclaration(&M, Intrinsic::frameaddress,
+                                          {Type::getInt8PtrTy(M.getContext())});
   StackAddrFn = Intrinsic::getDeclaration(&M, Intrinsic::stacksave);
----------------
This needs to use the alloca address space


================
Comment at: lib/Target/X86/X86WinEHState.cpp:343
+          Intrinsic::getDeclaration(TheModule, Intrinsic::frameaddress,
+                                    Builder.getInt8PtrTy()),
           Builder.getInt32(0), "frameaddr");
----------------
Ditto


================
Comment at: lib/Transforms/Instrumentation/HWAddressSanitizer.cpp:769
   auto GetStackPointerFn =
-      Intrinsic::getDeclaration(M, Intrinsic::frameaddress);
+      Intrinsic::getDeclaration(M, Intrinsic::frameaddress, Int8PtrTy);
   Value *StackPointer = IRB.CreateCall(
----------------
Ditto


================
Comment at: lib/Transforms/Instrumentation/HWAddressSanitizer.cpp:903
+    auto GetStackPointerFn = Intrinsic::getDeclaration(
+        F->getParent(), Intrinsic::frameaddress, Int8PtrTy);
     Value *SP = IRB.CreatePtrToInt(
----------------
Ditto


================
Comment at: lib/Transforms/Instrumentation/SanitizerCoverage.cpp:846
+    Function *GetFrameAddr = Intrinsic::getDeclaration(
+        F.getParent(), Intrinsic::frameaddress, Int8PtrTy);
     auto FrameAddrPtr =
----------------
Ditto


Repository:
  rL LLVM

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

https://reviews.llvm.org/D64561





More information about the llvm-commits mailing list