[llvm-branch-commits] [llvm] InferAddressSpaces: Handle llvm.is.constant (PR #102010)
Artem Belevich via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Aug 5 11:44:26 PDT 2024
================
@@ -429,6 +430,15 @@ void InferAddressSpacesImpl::collectRewritableIntrinsicOperands(
appendsFlatAddressExpressionToPostorderStack(II->getArgOperand(0),
PostorderStack, Visited);
break;
+ case Intrinsic::is_constant: {
+ Value *Ptr = II->getArgOperand(0);
+ if (Ptr->getType()->isPtrOrPtrVectorTy()) {
+ appendsFlatAddressExpressionToPostorderStack(Ptr, PostorderStack,
+ Visited);
+ }
----------------
Artem-B wrote:
> It should never be wrong to include braces.
Having to deal with google style that demands braces everywhere, and LLVM which does not want them, my personal choice is "whatever the style guide says". It may not always be a perfect choice, but it's not worth anyone's time to argue over specific instances, where the right choice is ambiguous or is a matter of personal preference. I wish we could delegate braces/no-braces decisions to clang-format, too, but I don't think it currently handles that.
I'd stick with the style guide defaults and either have the braces removed, or a comment added to the body. Perhaps, making the function name shorter, and avoiding line-wrapping would address your readability concerns about braces/no-braces here, too.
https://github.com/llvm/llvm-project/pull/102010
More information about the llvm-branch-commits
mailing list