[PATCH] D109357: [GlobalISel] Add a combine for and(load , mask) -> zextload
Konstantin Schwarz via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 9 03:11:23 PDT 2021
kschwarz added inline comments.
================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:668
+ Register PtrReg = LoadMI->getPointerReg();
+ unsigned NewSize = std::min((uint64_t)MaskVal.countTrailingOnes(),
+ LoadMI->getMemSizeInBits());
----------------
foad wrote:
> This looks like it will combine:
> ```
> %1:_(s32) = G_CONSTANT i32 65535
> %2:_(s32) = G_SEXTLOAD %0 :: (load (s8))
> %3:_(s32) = G_AND %2, %1
> ```
> into:
> ```
> %2:_(s32) = G_ZEXTLOAD %0 :: (load (s8))
> ```
> which would be wrong.
Good catch, thanks!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109357/new/
https://reviews.llvm.org/D109357
More information about the llvm-commits
mailing list