[PATCH] D12920: Add TargetCustom type to PseudoSourceValue

Marcello Maggioni via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 18:41:46 PDT 2015


kariddi updated this revision to Diff 34958.
kariddi added a comment.

- Updated to implement Matt's suggestion.

- Speculatively modified the MIR printer to not handle the TargetCustom PSV as it should be lower than the level MIR printer/parser operates .... but I'm not sure of that and I need a look from somebody working on MIR as I don't know a lot about it.


http://reviews.llvm.org/D12920

Files:
  include/llvm/CodeGen/PseudoSourceValue.h
  lib/CodeGen/MIRPrinter.cpp

Index: lib/CodeGen/MIRPrinter.cpp
===================================================================
--- lib/CodeGen/MIRPrinter.cpp
+++ lib/CodeGen/MIRPrinter.cpp
@@ -892,6 +892,9 @@
       printLLVMNameWithoutPrefix(
           OS, cast<ExternalSymbolPseudoSourceValue>(PVal)->getSymbol());
       break;
+    case PseudoSourceValue::TargetCustom:
+      llvm_unreachable("TargetCustom pseudo source values are not supported");
+      break;
     }
   }
   printOffset(Op.getOffset());
Index: include/llvm/CodeGen/PseudoSourceValue.h
===================================================================
--- include/llvm/CodeGen/PseudoSourceValue.h
+++ include/llvm/CodeGen/PseudoSourceValue.h
@@ -40,7 +40,8 @@
     ConstantPool,
     FixedStack,
     GlobalValueCallEntry,
-    ExternalSymbolCallEntry
+    ExternalSymbolCallEntry,
+    TargetCustom
   };
 
 private:
@@ -63,6 +64,9 @@
   bool isGOT() const { return Kind == GOT; }
   bool isConstantPool() const { return Kind == ConstantPool; }
   bool isJumpTable() const { return Kind == JumpTable; }
+  unsigned isTargetCustom() const {
+    return (Kind >= TargetCustom) ? ((Kind+1) - TargetCustom) : 0;
+  }
 
   /// Test whether the memory pointed to by this PseudoSourceValue has a
   /// constant value.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12920.34958.patch
Type: text/x-patch
Size: 1265 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150917/320e2d8f/attachment.bin>


More information about the llvm-commits mailing list