[PATCH] D128052: Basic types for LLVM

Guillaume Chatelet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 22 06:58:22 PST 2022


gchatelet added inline comments.


================
Comment at: llvm/include/llvm/Support/BasicTypes.h:420
+    Value >>= Shift;
+    Value <<= Shift;
+    return Value;
----------------
arichardson wrote:
> Would it be possible to change this to masking off low bits instead of shifting? I'm not sure if this code is going to be used for actual pointers, but if it is, the current shifting pattern is incompatible with CHERI hosts such as Arm Morello. On CHERI systems, shifting a pointer will cause it to go so far out of bounds that it becomes invalidated (the bounds are encoded relative to the address and if the address goes too far out of bounds the can no longer be represented).
> 
> Also it looks like RISC-V already does this conversion from shift to mask: https://godbolt.org/z/15KfM78Tn
I see, thx for the comment. I'll go with masking instead.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128052



More information about the llvm-commits mailing list