gollvm: relax assert on rhs type for left/right shift

Relax an assert in the IR materializer related to shift amount
expressions; with Go 1.13 the compiler will allow the shift amount
operand to be a signed integer (being rolled out in frontend change
CL/190977).

Updates golang/go#19113.

Change-Id: I0cf7633e76a825fcf91c21ba9f4a4ca789e9c05e
Reviewed-on: https://go-review.googlesource.com/c/gollvm/+/190901
Reviewed-by: Cherry Zhang <cherryyz@google.com>
diff --git a/bridge/go-llvm-materialize.cpp b/bridge/go-llvm-materialize.cpp
index 4afc5fe..c25f897 100644
--- a/bridge/go-llvm-materialize.cpp
+++ b/bridge/go-llvm-materialize.cpp
@@ -717,10 +717,11 @@
   assert((blitype == nullptr) == (britype == nullptr));
   bool isUnsigned = false;
   if (blitype) {
-    if (op == OPERATOR_LSHIFT || op == OPERATOR_RSHIFT)
-      assert(britype->isUnsigned());
-    else
-      assert(blitype->isUnsigned() == britype->isUnsigned());
+    // As of Go 1.13, shift amount is allowed to be a signed integer.
+    // Note that the front end emits tests to guard against negative
+    // shift amounts.
+    assert(op == OPERATOR_LSHIFT || op == OPERATOR_RSHIFT ||
+           blitype->isUnsigned() == britype->isUnsigned());
     isUnsigned = blitype->isUnsigned();
   }
   LIRBuilder builder(context_, llvm::ConstantFolder());