[PATCH] D88031: GlobalISel: Fix truncating shift amount in trunc (shl) combine

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 09:36:23 PDT 2020


arsenm created this revision.
arsenm added reviewers: aemerson, paquette, mkitzan.
Herald added subscribers: kerbowa, hiraditya, rovka, nhaehnle, jvesely.
Herald added a project: LLVM.
arsenm requested review of this revision.
Herald added a subscriber: wdng.

The shift amount type does not necessarily match the result type. This
was inserting a trunc from s32 to s32, which asserted. Just preserve
the original shift amount type which can be legalized later.


https://reviews.llvm.org/D88031

Files:
  llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/combine-trunc.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/combine-trunc-shl.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88031.293201.patch
Type: text/x-patch
Size: 3795 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200921/824f07b7/attachment.bin>


More information about the llvm-commits mailing list