From 8fa6bf35db8a4d89986ee62daa48a7fc7a76c83b Mon Sep 17 00:00:00 2001
From: aejjeh <aejjeh@illinois.edu>
Date: Tue, 21 Jan 2020 13:15:40 -0600
Subject: [PATCH] Removing patches and adding to gitignore

---
 .gitignore                                    |  3 +-
 .../include/Bitcode/LLVMBitCodes.h.patch      | 12 ------
 .../include/IR/Attributes.td.patch            | 20 ----------
 .../include/IR/Intrinsics.td.patch            |  7 ----
 .../include/IR/IntrinsicsVISC.td.patch        |  0
 .../include/Support/Debug.h.patch             | 11 ------
 .../lib/AsmParser/LLLexer.cpp.patch           | 14 -------
 .../lib/AsmParser/LLLexer.h.patch             |  0
 .../lib/AsmParser/LLParser.cpp.patch          | 38 -------------------
 .../lib/AsmParser/LLParser.h.patch            |  0
 .../lib/AsmParser/LLToken.h.patch             | 14 -------
 .../Bitcode/Reader/BitcodeReader.cpp.patch    | 15 --------
 .../Bitcode/Writer/BitcodeWriter.cpp.patch    | 18 ---------
 hpvm/llvm_patches/lib/IR/Attributes.cpp.patch | 17 ---------
 14 files changed, 2 insertions(+), 167 deletions(-)
 delete mode 100644 hpvm/llvm_patches/include/Bitcode/LLVMBitCodes.h.patch
 delete mode 100644 hpvm/llvm_patches/include/IR/Attributes.td.patch
 delete mode 100644 hpvm/llvm_patches/include/IR/Intrinsics.td.patch
 delete mode 100644 hpvm/llvm_patches/include/IR/IntrinsicsVISC.td.patch
 delete mode 100644 hpvm/llvm_patches/include/Support/Debug.h.patch
 delete mode 100644 hpvm/llvm_patches/lib/AsmParser/LLLexer.cpp.patch
 delete mode 100644 hpvm/llvm_patches/lib/AsmParser/LLLexer.h.patch
 delete mode 100644 hpvm/llvm_patches/lib/AsmParser/LLParser.cpp.patch
 delete mode 100644 hpvm/llvm_patches/lib/AsmParser/LLParser.h.patch
 delete mode 100644 hpvm/llvm_patches/lib/AsmParser/LLToken.h.patch
 delete mode 100644 hpvm/llvm_patches/lib/Bitcode/Reader/BitcodeReader.cpp.patch
 delete mode 100644 hpvm/llvm_patches/lib/Bitcode/Writer/BitcodeWriter.cpp.patch
 delete mode 100644 hpvm/llvm_patches/lib/IR/Attributes.cpp.patch

diff --git a/.gitignore b/.gitignore
index 70639e367b..a17e2716a5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,6 +27,7 @@ cfg.foo.dot
 lit.site.cfg
 *.dot
 JITTests.exports
+*.patch
 
 hpvm/build/
 hpvm/install/
@@ -34,4 +35,4 @@ hpvm/llvm/
 hpvm/llvm-*.src.tar.xz
 hpvm/llvm-*.src/
 hpvm/projects/visc-rt/visc-rt.ll
-hpvm/test/parboil/benchmarks/*/build/
+hpvm/test/**/build/
diff --git a/hpvm/llvm_patches/include/Bitcode/LLVMBitCodes.h.patch b/hpvm/llvm_patches/include/Bitcode/LLVMBitCodes.h.patch
deleted file mode 100644
index 30da826886..0000000000
--- a/hpvm/llvm_patches/include/Bitcode/LLVMBitCodes.h.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- /home/akashk4/hpvm/hpvm/llvm/include/llvm/Bitcode/LLVMBitCodes.h	2019-07-15 15:02:23.000000000 -0500
-+++ include/Bitcode/LLVMBitCodes.h	2020-01-09 00:27:16.654327975 -0600
-@@ -632,6 +632,9 @@
-   ATTR_KIND_NOFREE = 62,
-   ATTR_KIND_NOSYNC = 63,
-   ATTR_KIND_SANITIZE_MEMTAG = 64,
-+  ATTR_KIND_IN = 65,
-+  ATTR_KIND_OUT = 66,
-+  ATTR_KIND_INOUT = 67,
- };
- 
- enum ComdatSelectionKindCodes {
diff --git a/hpvm/llvm_patches/include/IR/Attributes.td.patch b/hpvm/llvm_patches/include/IR/Attributes.td.patch
deleted file mode 100644
index d2dac7ba94..0000000000
--- a/hpvm/llvm_patches/include/IR/Attributes.td.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- /home/akashk4/hpvm/hpvm/llvm/include/llvm/IR/Attributes.td	2019-07-15 15:02:23.000000000 -0500
-+++ include/IR/Attributes.td	2020-01-09 00:27:16.659328383 -0600
-@@ -151,6 +151,17 @@
- /// Sign extended before/after call.
- def SExt : EnumAttr<"signext">;
- 
-+/// VISC Attributes
-+/// Pointer to read only memory
-+def In : EnumAttr<"in">;
-+
-+/// Pointer to write only memory
-+def Out : EnumAttr<"out">;
-+
-+/// Pointer to read/write memory
-+def InOut : EnumAttr<"inout">;
-+
-+
- /// Alignment of stack for function (3 bits)  stored as log2 of alignment with
- /// +1 bias 0 means unaligned (different from alignstack=(1)).
- def StackAlignment : EnumAttr<"alignstack">;
diff --git a/hpvm/llvm_patches/include/IR/Intrinsics.td.patch b/hpvm/llvm_patches/include/IR/Intrinsics.td.patch
deleted file mode 100644
index 8f18304595..0000000000
--- a/hpvm/llvm_patches/include/IR/Intrinsics.td.patch
+++ /dev/null
@@ -1,7 +0,0 @@
---- /home/akashk4/hpvm/hpvm/llvm/include/llvm/IR/Intrinsics.td	2019-07-17 10:15:43.000000000 -0500
-+++ include/IR/Intrinsics.td	2020-01-09 00:27:16.663328710 -0600
-@@ -1249,3 +1249,4 @@
- include "llvm/IR/IntrinsicsSystemZ.td"
- include "llvm/IR/IntrinsicsWebAssembly.td"
- include "llvm/IR/IntrinsicsRISCV.td"
-+include "llvm/IR/IntrinsicsVISC.td"
diff --git a/hpvm/llvm_patches/include/IR/IntrinsicsVISC.td.patch b/hpvm/llvm_patches/include/IR/IntrinsicsVISC.td.patch
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/hpvm/llvm_patches/include/Support/Debug.h.patch b/hpvm/llvm_patches/include/Support/Debug.h.patch
deleted file mode 100644
index 4db5c09045..0000000000
--- a/hpvm/llvm_patches/include/Support/Debug.h.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- /home/akashk4/hpvm/hpvm/llvm/include/llvm/Support/Debug.h	2019-01-19 02:50:56.000000000 -0600
-+++ include/Support/Debug.h	2020-01-09 00:27:16.671329363 -0600
-@@ -121,6 +121,8 @@
- //
- #define LLVM_DEBUG(X) DEBUG_WITH_TYPE(DEBUG_TYPE, X)
- 
-+#define DEBUG(X) DEBUG_WITH_TYPE(DEBUG_TYPE, X)
-+
- } // end namespace llvm
- 
- #endif // LLVM_SUPPORT_DEBUG_H
diff --git a/hpvm/llvm_patches/lib/AsmParser/LLLexer.cpp.patch b/hpvm/llvm_patches/lib/AsmParser/LLLexer.cpp.patch
deleted file mode 100644
index 2d0a972ea4..0000000000
--- a/hpvm/llvm_patches/lib/AsmParser/LLLexer.cpp.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- /home/akashk4/hpvm/hpvm/llvm/lib/AsmParser/LLLexer.cpp	2019-07-15 15:02:23.000000000 -0500
-+++ lib/AsmParser/LLLexer.cpp	2020-01-09 00:27:16.678329935 -0600
-@@ -800,6 +800,11 @@
-   KEYWORD(bit);
-   KEYWORD(varFlags);
- 
-+// VISC parameter attributes
-+   KEYWORD(in);
-+   KEYWORD(out);
-+   KEYWORD(inout);
-+
- #undef KEYWORD
- 
-   // Keywords for types.
diff --git a/hpvm/llvm_patches/lib/AsmParser/LLLexer.h.patch b/hpvm/llvm_patches/lib/AsmParser/LLLexer.h.patch
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/hpvm/llvm_patches/lib/AsmParser/LLParser.cpp.patch b/hpvm/llvm_patches/lib/AsmParser/LLParser.cpp.patch
deleted file mode 100644
index 339488ac08..0000000000
--- a/hpvm/llvm_patches/lib/AsmParser/LLParser.cpp.patch
+++ /dev/null
@@ -1,38 +0,0 @@
---- /home/akashk4/hpvm/hpvm/llvm/lib/AsmParser/LLParser.cpp	2019-07-15 15:02:23.000000000 -0500
-+++ lib/AsmParser/LLParser.cpp	2020-01-09 00:27:16.690330915 -0600
-@@ -1346,6 +1346,11 @@
-     case lltok::kw_swifterror:
-     case lltok::kw_swiftself:
-     case lltok::kw_immarg:
-+    
-+    // VISC Parameter only attributes
-+    case lltok::kw_in:
-+    case lltok::kw_out:
-+    case lltok::kw_inout:
-       HaveError |=
-         Error(Lex.getLoc(),
-               "invalid use of parameter-only attribute on a function");
-@@ -1647,6 +1652,11 @@
-     case lltok::kw_zeroext:         B.addAttribute(Attribute::ZExt); break;
-     case lltok::kw_immarg:          B.addAttribute(Attribute::ImmArg); break;
- 
-+    // VISC parameter attributes
-+    case lltok::kw_in:              B.addAttribute(Attribute::In); break;
-+    case lltok::kw_out:             B.addAttribute(Attribute::Out); break;
-+    case lltok::kw_inout:           B.addAttribute(Attribute::InOut); break;
-+
-     case lltok::kw_alignstack:
-     case lltok::kw_alwaysinline:
-     case lltok::kw_argmemonly:
-@@ -1742,6 +1752,11 @@
-     case lltok::kw_swifterror:
-     case lltok::kw_swiftself:
-     case lltok::kw_immarg:
-+
-+    // VISC Parameter only attributes
-+    case lltok::kw_in:
-+    case lltok::kw_out:
-+    case lltok::kw_inout:
-       HaveError |= Error(Lex.getLoc(), "invalid use of parameter-only attribute");
-       break;
- 
diff --git a/hpvm/llvm_patches/lib/AsmParser/LLParser.h.patch b/hpvm/llvm_patches/lib/AsmParser/LLParser.h.patch
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/hpvm/llvm_patches/lib/AsmParser/LLToken.h.patch b/hpvm/llvm_patches/lib/AsmParser/LLToken.h.patch
deleted file mode 100644
index 900be4996d..0000000000
--- a/hpvm/llvm_patches/lib/AsmParser/LLToken.h.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- /home/akashk4/hpvm/hpvm/llvm/lib/AsmParser/LLToken.h	2019-07-15 15:02:23.000000000 -0500
-+++ lib/AsmParser/LLToken.h	2020-01-09 00:27:16.696331405 -0600
-@@ -351,6 +351,11 @@
-   kw_insertvalue,
-   kw_blockaddress,
- 
-+   // VISC parameter attributes
-+   kw_in, 
-+   kw_out,
-+   kw_inout,
-+
-   // Metadata types.
-   kw_distinct,
- 
diff --git a/hpvm/llvm_patches/lib/Bitcode/Reader/BitcodeReader.cpp.patch b/hpvm/llvm_patches/lib/Bitcode/Reader/BitcodeReader.cpp.patch
deleted file mode 100644
index 82caa0656d..0000000000
--- a/hpvm/llvm_patches/lib/Bitcode/Reader/BitcodeReader.cpp.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- /home/akashk4/hpvm/hpvm/llvm/lib/Bitcode/Reader/BitcodeReader.cpp	2019-07-15 15:02:23.000000000 -0500
-+++ lib/Bitcode/Reader/BitcodeReader.cpp	2020-01-09 00:27:16.708332385 -0600
-@@ -1280,6 +1280,12 @@
-     return 1ULL << 62;
-   case Attribute::NoFree:
-     return 1ULL << 63;
-+
-+   // VISC Attributes
-+  case Attribute::In:              return 3ULL << 0;
-+  case Attribute::Out:             return 3ULL << 1;  
-+  case Attribute::InOut:           return 3ULL << 2;
-+
-   case Attribute::NoSync:
-     llvm_unreachable("nosync attribute not supported in raw format");
-     break;
diff --git a/hpvm/llvm_patches/lib/Bitcode/Writer/BitcodeWriter.cpp.patch b/hpvm/llvm_patches/lib/Bitcode/Writer/BitcodeWriter.cpp.patch
deleted file mode 100644
index d2492681d9..0000000000
--- a/hpvm/llvm_patches/lib/Bitcode/Writer/BitcodeWriter.cpp.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- /home/akashk4/hpvm/hpvm/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp	2019-07-15 15:02:23.000000000 -0500
-+++ lib/Bitcode/Writer/BitcodeWriter.cpp	2020-01-09 00:27:16.716333039 -0600
-@@ -725,6 +725,15 @@
-     return bitc::ATTR_KIND_IMMARG;
-   case Attribute::SanitizeMemTag:
-     return bitc::ATTR_KIND_SANITIZE_MEMTAG;
-+
-+  // VISC Attributes
-+  case Attribute::In:
-+    return bitc::ATTR_KIND_IN;
-+  case Attribute::Out:
-+    return bitc::ATTR_KIND_OUT;
-+  case Attribute::InOut:
-+    return bitc::ATTR_KIND_INOUT;
-+
-   case Attribute::EndAttrKinds:
-     llvm_unreachable("Can not encode end-attribute kinds marker.");
-   case Attribute::None:
diff --git a/hpvm/llvm_patches/lib/IR/Attributes.cpp.patch b/hpvm/llvm_patches/lib/IR/Attributes.cpp.patch
deleted file mode 100644
index 8f112fa220..0000000000
--- a/hpvm/llvm_patches/lib/IR/Attributes.cpp.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- /home/akashk4/hpvm/hpvm/llvm/lib/IR/Attributes.cpp	2019-07-15 15:02:23.000000000 -0500
-+++ lib/IR/Attributes.cpp	2020-01-09 00:27:16.722333529 -0600
-@@ -396,6 +396,14 @@
-   if (hasAttribute(Attribute::ImmArg))
-     return "immarg";
- 
-+  // VISC attributes for arguments
-+  if (hasAttribute(Attribute::In))
-+    return "in";
-+  if (hasAttribute(Attribute::Out))
-+    return "out";
-+  if (hasAttribute(Attribute::InOut))
-+    return "inout";
-+
-   if (hasAttribute(Attribute::ByVal)) {
-     std::string Result;
-     Result += "byval";
-- 
GitLab