diff --git a/llvm/lib/Target/NVPTX/NVPTXInstrInfo.td b/llvm/lib/Target/NVPTX/NVPTXInstrInfo.td --- a/llvm/lib/Target/NVPTX/NVPTXInstrInfo.td +++ b/llvm/lib/Target/NVPTX/NVPTXInstrInfo.td @@ -732,15 +732,15 @@ }]>; def Int5Const : PatLeaf<(imm), [{ - // Check if 0 <= v < 32; only then will the result of (x << v) be an int32. + // Check if 0 <= v < 31; only then will the result of (x << v) be an int32. const APInt &v = N->getAPIntValue(); - return v.sge(0) && v.slt(32); + return v.sge(0) && v.slt(31); }]>; def Int4Const : PatLeaf<(imm), [{ - // Check if 0 <= v < 16; only then will the result of (x << v) be an int16. + // Check if 0 <= v < 15; only then will the result of (x << v) be an int16. const APInt &v = N->getAPIntValue(); - return v.sge(0) && v.slt(16); + return v.sge(0) && v.slt(15); }]>; def SHL2MUL32 : SDNodeXForm