[AMDGPU] make ubsan happy with unsigned left shift
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Mon, 15 Jun 2020 23:57:33 +0000 (16:57 -0700)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Tue, 16 Jun 2020 00:21:10 +0000 (17:21 -0700)
Fixes UBSAN error after rG9ee272f13d88f090817235ef4f91e56bb2a153d6
A trivial signed/unsigned shift.

llvm/lib/Target/AMDGPU/SMInstructions.td

index 252f191..df21c86 100644 (file)
@@ -860,7 +860,7 @@ let OtherPredicates = [HasNoSMemTimeInst] in {
 def : GCNPat <
   (i64 (readcyclecounter)),
   (REG_SEQUENCE SReg_64,
-    (S_GETREG_B32 getHwRegImm<HWREG.SHADER_CYCLES, 0, -12>.ret), sub0,
+    (S_GETREG_B32 -26595), sub0,
     (S_MOV_B32 (i32 0)), sub1)
 >;
 } // let OtherPredicates = [HasNoSMemTimeInst]