Index: llvm/include/llvm/IR/Attributes.td =================================================================== --- llvm/include/llvm/IR/Attributes.td +++ llvm/include/llvm/IR/Attributes.td @@ -1,3 +1,15 @@ +//===- Attributes.td - Defines all LLVM attributes ---------*- tablegen -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// This file defines all the LLVM attributes. +// +//===----------------------------------------------------------------------===// + /// Attribute base class. class Attr { // String representation of this attribute in the IR. Index: llvm/include/llvm/IR/Intrinsics.td =================================================================== --- llvm/include/llvm/IR/Intrinsics.td +++ llvm/include/llvm/IR/Intrinsics.td @@ -17,7 +17,7 @@ // Properties we keep track of for intrinsics. //===----------------------------------------------------------------------===// -class IntrinsicProperty { +class IntrinsicProperty { bit IsDefault = is_default; } @@ -161,7 +161,7 @@ class LLVMType { ValueType VT = vt; - int isAny = 0; + int isAny = false; } class LLVMQualPointerType @@ -177,7 +177,7 @@ : LLVMType{ LLVMType ElTy = elty; - let isAny = 1; + let isAny = true; } // Match the type of another intrinsic parameter. Number is an index into the @@ -226,7 +226,7 @@ class LLVMVectorOfBitcastsToInt : LLVMMatchType; def llvm_void_ty : LLVMType; -let isAny = 1 in { +let isAny = true in { def llvm_any_ty : LLVMType; def llvm_anyint_ty : LLVMType; def llvm_anyfloat_ty : LLVMType; @@ -342,7 +342,7 @@ list intr_properties = [], string name = "", list sd_properties = [], - bit disable_default_attributes = 1> : SDPatternOperator { + bit disable_default_attributes = true> : SDPatternOperator { string LLVMName = name; string TargetPrefix = ""; // Set to a prefix for target-specific intrinsics. list RetTypes = ret_types; @@ -354,10 +354,10 @@ // IntrinsicProperty<1> bit DisableDefaultAttributes = disable_default_attributes; - bit isTarget = 0; + bit isTarget = false; } -// Intrinisc with default attributes (disable_default_attributes = 0). +// Intrinisc with default attributes (disable_default_attributes = false). class DefaultAttrsIntrinsic ret_types, list param_types = [], list intr_properties = [], Index: llvm/include/llvm/IR/IntrinsicsAMDGPU.td =================================================================== --- llvm/include/llvm/IR/IntrinsicsAMDGPU.td +++ llvm/include/llvm/IR/IntrinsicsAMDGPU.td @@ -18,7 +18,7 @@ // Used to tag image and resource intrinsics with information used to generate // mem operands. -class AMDGPURsrcIntrinsic { +class AMDGPURsrcIntrinsic { int RsrcArg = rsrcarg; bit IsImage = isimage; } @@ -511,7 +511,7 @@ string Name = name; // e.g. "2darraymsaa" string AsmSuffix = asmsuffix; // e.g. 2D_MSAA_ARRAY (used in assembly strings) bits<3> Encoding = enc; - bit DA = 0; // DA bit in MIMG encoding + bit DA = false; // DA bit in MIMG encoding list CoordSliceArgs = makeArgList.ret; @@ -529,13 +529,13 @@ def AMDGPUDim1D : AMDGPUDimProps<0x0, "1d", "1D", ["s"], []>; def AMDGPUDim2D : AMDGPUDimProps<0x1, "2d", "2D", ["s", "t"], []>; def AMDGPUDim3D : AMDGPUDimProps<0x2, "3d", "3D", ["s", "t", "r"], []>; -let DA = 1 in { +let DA = true in { def AMDGPUDimCube : AMDGPUDimProps<0x3, "cube", "CUBE", ["s", "t"], ["face"]>; def AMDGPUDim1DArray : AMDGPUDimProps<0x4, "1darray", "1D_ARRAY", ["s"], ["slice"]>; def AMDGPUDim2DArray : AMDGPUDimProps<0x5, "2darray", "2D_ARRAY", ["s", "t"], ["slice"]>; } def AMDGPUDim2DMsaa : AMDGPUDimProps<0x6, "2dmsaa", "2D_MSAA", ["s", "t"], ["fragid"]>; -let DA = 1 in { +let DA = true in { def AMDGPUDim2DArrayMsaa : AMDGPUDimProps<0x7, "2darraymsaa", "2D_MSAA_ARRAY", ["s", "t"], ["slice", "fragid"]>; } @@ -554,7 +554,7 @@ // {offset} {bias} {z-compare} list ExtraAddrArgs = extra_addr; - bit Gradients = 0; + bit Gradients = false; // Name of the {lod} or {clamp} argument that is appended to the coordinates, // if any. @@ -594,7 +594,7 @@ defm AMDGPUSample : AMDGPUSampleHelper_Compare<"_LZ", "_lz", []>; } - let Gradients = 1 in { + let Gradients = true in { defm AMDGPUSample : AMDGPUSampleHelper_Clamp<"_D", "_d", []>; defm AMDGPUSample : AMDGPUSampleHelper_Clamp<"_CD", "_cd", []>; } @@ -609,12 +609,12 @@ string OpMod = opmod; // the corresponding instruction is named IMAGE_OpMod // These are intended to be overwritten by subclasses - bit IsSample = 0; - bit IsAtomic = 0; + bit IsSample = false; + bit IsAtomic = false; list RetTypes = []; list DataArgs = []; list ExtraAddrArgs = []; - bit Gradients = 0; + bit Gradients = false; string LodClampMip = ""; int NumRetAndDataAnyTypes = @@ -625,7 +625,7 @@ arglistconcat<[ExtraAddrArgs, !if(Gradients, dim.GradientArgs, []), !listconcat(!if(IsSample, dim.CoordSliceArgs, dim.CoordSliceIntArgs), - !if(!eq(LodClampMip, ""), + !if(!empty(LodClampMip), [], [AMDGPUArg, LodClampMip>]))], NumRetAndDataAnyTypes>.ret; @@ -655,7 +655,7 @@ class AMDGPUDimSampleProfile : AMDGPUDimProfile { - let IsSample = 1; + let IsSample = true; let RetTypes = [llvm_any_ty]; let ExtraAddrArgs = sample.ExtraAddrArgs; let Gradients = sample.Gradients; @@ -666,7 +666,7 @@ AMDGPUDimProps dim, list retty, list dataargs, - bit Mip = 0> : AMDGPUDimProfile { + bit Mip = false> : AMDGPUDimProfile { let RetTypes = retty; let DataArgs = dataargs; let LodClampMip = !if(Mip, "mip", ""); @@ -677,7 +677,7 @@ list dataargs> : AMDGPUDimProfile { let RetTypes = [llvm_anyint_ty]; let DataArgs = dataargs; - let IsAtomic = 1; + let IsAtomic = true; } class AMDGPUDimGetResInfoProfile : AMDGPUDimProfile<"GET_RESINFO", dim> { @@ -690,7 +690,7 @@ // Helper class for figuring out image intrinsic argument indexes. class AMDGPUImageDimIntrinsicEval { int NumDataArgs = !size(P_.DataArgs); - int NumDmaskArgs = !if(P_.IsAtomic, 0, 1); + int NumDmaskArgs = !not(P_.IsAtomic); int NumExtraAddrArgs = !size(P_.ExtraAddrArgs); int NumVAddrArgs = !size(P_.AddrArgs); int NumGradientArgs = !if(P_.Gradients, !size(P_.Dim.GradientArgs), 0); @@ -757,7 +757,7 @@ list dataargs, list props, list sdnodeprops, - bit Mip = 0> { + bit Mip = false> { foreach dim = AMDGPUDims.NoMsaa in { def !strconcat(NAME, "_", dim.Name) : AMDGPUImageDimIntrinsic< @@ -771,7 +771,7 @@ list dataargs, list props, list sdnodeprops, - bit Mip = 0> { + bit Mip = false> { foreach dim = AMDGPUDims.All in { def !strconcat(NAME, "_", dim.Name) : AMDGPUImageDimIntrinsic< @@ -806,7 +806,7 @@ ////////////////////////////////////////////////////////////////////////// multiclass AMDGPUImageDimSampleDims { + bit NoMem = false> { foreach dim = AMDGPUDims.NoMsaa in { def !strconcat(NAME, "_", dim.Name) : AMDGPUImageDimIntrinsic< AMDGPUDimSampleProfile, @@ -992,7 +992,7 @@ def int_amdgcn_struct_buffer_store_format : AMDGPUStructBufferStore; def int_amdgcn_struct_buffer_store : AMDGPUStructBufferStore; -class AMDGPURawBufferAtomic : Intrinsic < +class AMDGPURawBufferAtomic : Intrinsic < !if(NoRtn, [], [data_ty]), [!if(NoRtn, data_ty, LLVMMatchType<0>), // vdata(VGPR) llvm_v4i32_ty, // rsrc(SGPR) @@ -1027,7 +1027,7 @@ // gfx908 intrinsic def int_amdgcn_raw_buffer_atomic_fadd : AMDGPURawBufferAtomic; -class AMDGPUStructBufferAtomic : Intrinsic < +class AMDGPUStructBufferAtomic : Intrinsic < !if(NoRtn, [], [data_ty]), [!if(NoRtn, data_ty, LLVMMatchType<0>), // vdata(VGPR) llvm_v4i32_ty, // rsrc(SGPR)