[PATCH] D37740: [SelectionDAG] Pick correct frame index in LowerArguments

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 12 10:53:57 PDT 2017


rnk added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:8791-8794
     // Note down frame index.
     if (FrameIndexSDNode *FI =
         dyn_cast<FrameIndexSDNode>(ArgValues[0].getNode()))
       FuncInfo->setArgumentFrameIndex(&Arg, FI->getIndex());
----------------
Is it possible to fix this condition up so that we don't pattern match the frame index before *and* after the getMergeValues? We should be able to look through LoadSDNodes here to check for a FrameIndexSDNode.


================
Comment at: test/CodeGen/PowerPC/debuginfo-stackarg.ll:45
+
+attributes #0 = { nounwind readnone ssp uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-features"="-altivec,-bpermd,-crypto,-direct-move,-extdiv,-htm,-power8-vector,-power9-vector,-qpx,-vsx" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #1 = { nounwind readnone speculatable }
----------------
aprantl wrote:
> please strip all non-essential attributes (everything in quotes?)
Eventually I'd like to make a pass that "canonicalizes" LLVM IR from clang to strip out all this hyper-target-specific junk (PIC size, wchar_size, regparms, etc). It would also remove the `optnone` attribute which continues to trip me up when I'm trying to generate "simple" LLVM IR for tests with `clang -O0`. I have to do `clang -O1 -Xclang -disable-llvm-passes`, and then I remove the lifetime markers because they are mostly noise for debug info.


https://reviews.llvm.org/D37740





More information about the llvm-commits mailing list