[PATCH] D45189: [MachineOutliner][AArch64] Keep track of functions that use a red zone in AArch64MachineFunctionInfo and use that instead of checking for noredzone in the MachineOutliner

Geoff Berry via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 3 07:27:01 PDT 2018


gberry added inline comments.


================
Comment at: lib/Target/AArch64/AArch64MachineFunctionInfo.h:94
+  /// True when the function uses a red zone.
+  bool UsesRedZone = false;
+
----------------
thegameg wrote:
> Since this is available only after PEI, I wonder if it wouldn't be safer to initialize `UsesRedZone` to `!F.hasFnAttribute(Attribute::NoRedZone)`. That way if the function is called before PEI we use the attribute, and after PEI we overwrite this.
If the value is going to change over time, perhaps you could name the function mightUseRedZone instead?
Or you could use an Option<bool> and assert if it is queried before it is set?


================
Comment at: test/CodeGen/AArch64/machine-outliner-noredzone.ll:7
+target triple = "arm64----"
+
+define void @foo() #0 {
----------------
This could use a one line description of what it is testing.


================
Comment at: test/CodeGen/AArch64/machine-outliner-noredzone.ll:9
+define void @foo() #0 {
+  %1 = alloca i32, align 4
+  %2 = alloca i32, align 4
----------------
I assume this test needs to be this large in order to cross some threshold to trigger outlining?


https://reviews.llvm.org/D45189





More information about the llvm-commits mailing list