[PATCH] D116819: [AMDGPU] Disable optimizeEndCf at -O0

Christudasan Devadasan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 7 17:42:59 PST 2022


cdevadas added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp:813
   TRI = &TII->getRegisterInfo();
+  EnableOptimizeEndCf =
+      RemoveRedundantEndcf && MF.getTarget().getOptLevel() > CodeGenOpt::None;
----------------
rampitec wrote:
> You can just check it where optimizeEndCf is called below.
There are two reasons why I did that:
1. There is already a check inside the function to skip it based on the command-line option. I want to unify all skips.
2. At any point in the future, if there are multiple such call-sites, it would be good to have the skip inserted at its entry.


================
Comment at: llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp:814
+  EnableOptimizeEndCf =
+      RemoveRedundantEndcf && MF.getTarget().getOptLevel() > CodeGenOpt::None;
 
----------------
arsenm wrote:
> rampitec wrote:
> > arsenm wrote:
> > > rampitec wrote:
> > > > There is skipFunction() method, it will check optnone attribute. Just checking -O0 does not check this.
> > > skipFunction wouldn't be appropriate because this is still a lowering pass we must run
> > It still can be checked to skip optimization part of it only. Isn't it?
> You can also just directly check optnone
Will do.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116819



More information about the llvm-commits mailing list