[PATCH] D18367: Introduce llvm.load.relative intrinsic.

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 10:47:44 PDT 2016


rnk added inline comments.

================
Comment at: docs/LangRef.rst:12194-12198
@@ +12193,7 @@
+
+LLVM provides that the calculation of such a constant initializer will
+not overflow at link time under the medium code model if ``x`` is an
+``unnamed_addr`` function, however it does not provide the same for a constant
+initializer folded into a function body; this intrinsic can be used to avoid
+the possibility of overflows when loading from such a constant.
+
----------------
Can the wording be improved here? This is a long sentence.

================
Comment at: lib/Analysis/InstructionSimplify.cpp:3806
@@ +3805,3 @@
+
+  uint64_t OffsetInt = cast<ConstantInt>(Offset)->getSExtValue();
+  if (OffsetInt % 4 != 0)
----------------
Now that the verifier uses an llvm_anyint_ty, you should probably check the bitwidth here to avoid crashing on crazy inputs.

================
Comment at: lib/CodeGen/PreISelIntrinsicLowering.cpp:1
@@ +1,2 @@
+//===-- PreISelIntrinsicLowering.cpp - Pre-ISel intrinsic lowering pass ---===//
+//
----------------
Should this lowering be done as part of CodeGenPrepare instead? We currently lower llvm.objectsize there.




http://reviews.llvm.org/D18367





More information about the llvm-commits mailing list