[llvm] [AMDGPU] - Add constant folding for s_quadmask (PR #72381)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 05:34:19 PST 2023


================
@@ -2422,6 +2423,19 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
 
       return ConstantFP::get(Ty->getContext(), Val);
     }
+
+    case Intrinsic::amdgcn_s_quadmask: {
+      uint64_t Val = Op->getZExtValue();
+      uint64_t QuadMask = 0;
+      for (unsigned i = 0; i < Op->getBitWidth() / 4; ++i, Val >>= 4) {
----------------
jayfoad wrote:

Upper case `I`

https://github.com/llvm/llvm-project/pull/72381


More information about the llvm-commits mailing list