[PATCH] D66678: [GlobalISel] Replace hard coded dynamic alloca handling with G_DYN_STACKALLOC
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 23 12:52:49 PDT 2019
arsenm added inline comments.
================
Comment at: llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp:1795-1796
+ // an address inside an alloca.
+ SDNodeFlags Flags;
+ Flags.setNoUnsignedWrap(true);
+ auto SAMinusOne = MIRBuilder.buildConstant(IntPtrTy, StackAlign - 1);
----------------
SDNodeFlags?
================
Comment at: llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp:1798-1800
+ auto AllocAdd =
+ MIRBuilder.buildInstr(TargetOpcode::G_ADD, {IntPtrTy},
+ {AllocSize, SAMinusOne}, MachineInstr::NoUWrap);
----------------
buildAdd?
================
Comment at: llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp:1803
+ MIRBuilder.buildConstant(IntPtrTy, ~(uint64_t)(StackAlign - 1));
+ auto AlignedAlloc = MIRBuilder.buildAnd(IntPtrTy, AllocAdd, AlignCst);
+
----------------
Why not use PtrMask?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66678/new/
https://reviews.llvm.org/D66678
More information about the llvm-commits
mailing list