[PATCH] D12255: AMDGPU/SI: Fix some invaild assumptions when folding 64-bit immediates

Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 28 18:59:34 PDT 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL246354: AMDGPU/SI: Fix some invaild assumptions when folding 64-bit immediates (authored by tstellar).

Changed prior to commit:
  http://reviews.llvm.org/D12255?vs=32880&id=33509#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12255

Files:
  llvm/trunk/lib/Target/AMDGPU/SIFoldOperands.cpp

Index: llvm/trunk/lib/Target/AMDGPU/SIFoldOperands.cpp
===================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIFoldOperands.cpp
+++ llvm/trunk/lib/Target/AMDGPU/SIFoldOperands.cpp
@@ -211,8 +211,12 @@
 
     Imm = APInt(64, OpToFold.getImm());
 
+    const MCInstrDesc &FoldDesc = TII->get(OpToFold.getParent()->getOpcode());
+    const TargetRegisterClass *FoldRC =
+        TRI.getRegClass(FoldDesc.OpInfo[0].RegClass);
+
     // Split 64-bit constants into 32-bits for folding.
-    if (UseOp.getSubReg()) {
+    if (FoldRC->getSize() == 8 && UseOp.getSubReg()) {
       if (UseRC->getSize() != 8)
         return;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12255.33509.patch
Type: text/x-patch
Size: 667 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150829/2717892a/attachment.bin>


More information about the llvm-commits mailing list