[PATCH] D88605: [GlobalISel] Fix CSEMIRBuilder silently allowing use-before-def.

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 12:43:38 PDT 2020


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

If a CSEMIRBuilder query hits the instruction at the current insert point, move insert point ahead one so that subsequent uses of the builder don't end up with uses before defs.

This fix also shows that AMDGPU was also affected by this bug often, but got away with it because it was using a G_IMPLICIT_DEF before the use.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88605

Files:
  llvm/lib/CodeGen/GlobalISel/CSEMIRBuilder.cpp
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-implicit-def.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-constant.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-flat.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-global.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-local.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-private.mir
  llvm/unittests/CodeGen/GlobalISel/CSETest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88605.295378.patch
Type: text/x-patch
Size: 128923 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200930/e06a3ebb/attachment.bin>


More information about the llvm-commits mailing list