[PATCH] D30428: [AMDGPU] Fix read-undef flags when schedule is reverted
Stanislav Mekhanoshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 27 13:24:06 PST 2017
rampitec created this revision.
Herald added subscribers: tpr, dstuttard, tony-tye, yaxunl, nhaehnle, wdng, kzhuravl, arsenm.
If two subregs of the same register are defined and we need to revert
schedule changing def order, we will end up with both instructions
having def,read-undef flags because adjustLaneLiveness() will only set
this flag but will not remove it.
Fix this by removing read-undef flags before calling adjustLaneLiveness.
Repository:
rL LLVM
https://reviews.llvm.org/D30428
Files:
lib/Target/AMDGPU/GCNSchedStrategy.cpp
Index: lib/Target/AMDGPU/GCNSchedStrategy.cpp
===================================================================
--- lib/Target/AMDGPU/GCNSchedStrategy.cpp
+++ lib/Target/AMDGPU/GCNSchedStrategy.cpp
@@ -350,6 +350,9 @@
BB->insert(RegionEnd, MI);
if (LIS) {
LIS->handleMove(*MI, true);
+ // Reset read-undef flags and update them later.
+ for (auto &Def : MI->defs())
+ Def.setIsUndef(false);
RegisterOperands RegOpers;
RegOpers.collect(*MI, *TRI, MRI, ShouldTrackLaneMasks, false);
if (ShouldTrackLaneMasks) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30428.89924.patch
Type: text/x-patch
Size: 584 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170227/2441fd5e/attachment.bin>
More information about the llvm-commits
mailing list