[PATCH] D19460: Fix incorrect redundant expresion in target AMDGPU.

Etienne Bergeron via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 23 12:16:45 PDT 2016

etienneb created this revision.
etienneb added a reviewer: rnk.
etienneb added a subscriber: cfe-commits.
Herald added a reviewer: tstellarAMD.
Herald added a subscriber: arsenm.

The expression is detected as a redundant expression.
Turn out, this is probably a bug.

/home/etienneb/llvm/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:306:26: warning: both side of operator are equivalent [misc-redundant-expression]
  if (isSMRD(*FirstLdSt) && isSMRD(*FirstLdSt)) {



Index: lib/Target/AMDGPU/SIInstrInfo.cpp
--- lib/Target/AMDGPU/SIInstrInfo.cpp
+++ lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -303,7 +303,7 @@
     SecondDst = getNamedOperand(*SecondLdSt, AMDGPU::OpName::vdst);
-  if (isSMRD(*FirstLdSt) && isSMRD(*FirstLdSt)) {
+  if (isSMRD(*FirstLdSt) && isSMRD(*SecondLdSt)) {
     FirstDst = getNamedOperand(*FirstLdSt, AMDGPU::OpName::sdst);
     SecondDst = getNamedOperand(*SecondLdSt, AMDGPU::OpName::sdst);

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19460.54787.patch
Type: text/x-patch
Size: 525 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160423/c6f429fb/attachment.bin>

More information about the cfe-commits mailing list