[PATCH] D104049: [AMDGPU] [CodeGen] Fold negate llvm.amdgcn.class into test mask
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 15 10:47:01 PDT 2021
arsenm added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp:831-839
+ if (isa<CallInst>(LHS) && isa<ConstantInt>(RHS) &&
+ cast<ConstantInt>(RHS)->getSExtValue() == -1)
+ Call = cast<CallInst>(LHS);
+ else if (isa<CallInst>(RHS) && isa<ConstantInt>(LHS) &&
+ cast<ConstantInt>(LHS)->getSExtValue() == -1)
+ Call = cast<CallInst>(RHS);
+ else {
----------------
arsenm wrote:
> I believe PatternMatch has a nicer way to check for a not
Plus constants are canonicalized to the RHS, so you don't need to check both
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104049/new/
https://reviews.llvm.org/D104049
More information about the llvm-commits
mailing list