[PATCH] D133766: [LLVM][AArch64] Don't warn about clobbering X16 when Speculative Load Hardening is used

David Spickett via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 14 08:09:16 PDT 2022


DavidSpickett marked an inline comment as done.
DavidSpickett added inline comments.


================
Comment at: llvm/test/CodeGen/AArch64/speculation-hardening-dagisel.ll:4-7
+; As SLH is falling back to a technique that doesn't use X16, we shouldn't see any warnings about clobbers.
+; (this would come from f_clobbered_reg_w16, but warnings are first in the output)
+; CHECK-NOT: warning: inline asm clobber list contains reserved registers: W16
+; CHECK-NOT: warning: inline asm clobber list contains reserved registers: X16
----------------
DavidSpickett wrote:
> kristof.beyls wrote:
> > The patch LGTM.
> > The only thing I was wondering whas if the test case could be hardened a bit further against the warning text changing in the future. If it does, the 2 CHECK-NOT lines probably would no longer be checking what is intended and no-one would notice.
> > I can't come up with a really good solution - so let's commit this as is.
> I might be able to reserve x16 using the equivalent of the command line option, for the non SLH run. Check that you do get the warning.
> 
> Then the test will fail if someone were to update it.
Turns out the way that option works, you can't use `-ffixed-x16` because clang ignores it. It does this for any register deemed too useful aka used in the ABI.

(at least clang tells you the argument is unused, gcc is just silent)

I guess we hope that future warning editors are smart enough to grep the test folders for the old phrasing.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133766



More information about the llvm-commits mailing list