[llvm-branch-commits] [llvm] InferAddressSpaces: Handle llvm.is.constant (PR #102010)

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Aug 5 10:18:27 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);
+    }
----------------
arsenm wrote:

Because unlike a compiler I read by lines, and not statements. 

The length of that section of the style guide is absurd. It should never be wrong to include braces. That's a lot simpler than parsing out whatever that is 

https://github.com/llvm/llvm-project/pull/102010


More information about the llvm-branch-commits mailing list