[llvm] r222581 - R600/SI: Add SIFoldOperands pass

Matt Arsenault arsenm2 at gmail.com
Fri Mar 13 21:04:40 PDT 2015


> On Mar 13, 2015, at 6:49 PM, Ahmed Bougacha <ahmed.bougacha at gmail.com> wrote:
> 
> On Fri, Nov 21, 2014 at 2:06 PM, Tom Stellard <thomas.stellard at amd.com> wrote:
>> Added: llvm/trunk/test/CodeGen/R600/operand-folding.ll
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/R600/operand-folding.ll?rev=222581&view=auto
>> ==============================================================================
>> --- llvm/trunk/test/CodeGen/R600/operand-folding.ll (added)
>> +++ llvm/trunk/test/CodeGen/R600/operand-folding.ll Fri Nov 21 16:06:37 2014
>> @@ -0,0 +1,40 @@
>> +; RUN: llc < %s -march=r600 -mcpu=SI -verify-machineinstrs | FileCheck %s
>> +
>> +; CHECK-LABEL: {{^}}fold_sgpr:
>> +; CHECK: v_add_i32_e32 v{{[0-9]+}}, s
>> +define void @fold_sgpr(i32 addrspace(1)* %out, i32 %fold) {
>> +entry:
>> +  %tmp0 = icmp ne i32 %fold, 0
>> +  br i1 %tmp0, label %if, label %endif
>> +
>> +if:
>> +  %id = call i32 @llvm.r600.read.tidig.x()
>> +  %offset = add i32 %fold, %id
>> +  %tmp1 = getelementptr i32 addrspace(1)* %out, i32 %offset
>> +  store i32 0, i32 addrspace(1)* %tmp1
>> +  br label %endif
>> +
>> +endif:
>> +  ret void
>> +}
>> +
>> +; CHECK-LABEL: {{^}}fold_imm:
>> +; CHECK v_or_i32_e32 v{{[0-9]+}}, 5
> 
> Hi Tom,
> 
> I noticed the `:` was missing, and adding it fails the test, which
> generates v_or_b32_e32.  Not sure that's correct, could you have a
> look?

That is correct, the real name of the instruction should be b32 instead of i32



More information about the llvm-commits mailing list