[PATCH] D100862: [InstCombine] Teach LLVM about guaranteed alignment for malloc and others
Dávid Bolvanský via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 20 09:07:37 PDT 2021
xbolva00 added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:2052
-void InstCombinerImpl::annotateAnyAllocSite(CallBase &Call, const TargetLibraryInfo *TLI) {
+static unsigned GuaranteedAlignmentForAllocFns(CallBase &Call) {
+ Triple T(Call.getModule()->getTargetTriple());
----------------
Basically reused info from Clang:
https://github.com/llvm/llvm-project/blob/d480f968ad8b56d3ee4a6b6df5532d485b0ad01e/clang/lib/Basic/TargetInfo.cpp#L72
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:2068
+ return 16;
+ return 0; // Unknown. Can we assume 8 ???
+}
----------------
Open question for review
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100862/new/
https://reviews.llvm.org/D100862
More information about the llvm-commits
mailing list