[PATCH] [DebugInfo] Add debug locations to constant SD nodes

Sergey Dmitrouk sdmitrouk at accesssoftek.com
Fri May 8 00:35:43 PDT 2015


REPOSITORY
  rL LLVM

================
Comment at: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h:423-426
@@ -425,1 +422,6 @@
+  SDValue getIntPtrConstant(uint64_t Val, SDLoc DL, bool isTarget = false);
+  SDValue getTargetConstant(uint64_t Val, SDLoc DL, EVT VT,
+                            bool isOpaque = false) {
+    return getConstant(Val, DL, VT, true, isOpaque);
   }
+  SDValue getTargetConstant(const APInt &Val, SDLoc DL, EVT VT,
----------------
arsenm wrote:
> Why do target constants need a debug location? The point of them is they aren't materialized in registers, and will eventually be embedded in an instruction. Should this skip the parameter for getTargetConstant and just use a null SDLoc?
> Why do target constants need a debug location? The point of them is they aren't materialized in registers, and will eventually be embedded in an instruction.

Sorry, I wasn't aware of this, I wish it were called `ImmConstant`, not `TargetConstant`... I would add a comment to these methods.

> Should this skip the parameter for getTargetConstant and just use a null SDLoc?

Well, if it's guaranteed that this location is not used in any way, it might be better to drop the parameter as well (including all overloads and FP constants). Could `TargetConstant` be turned into `Constant` as a result of some transformation? If not, I'll revert changes for these methods.

http://reviews.llvm.org/D9084

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list