[llvm-commits] [llvm] r162725 - in /llvm/trunk: lib/Target/PowerPC/PPCISelLowering.cpp lib/Target/PowerPC/PPCISelLowering.h lib/Target/PowerPC/PPCInstrInfo.td test/CodeGen/PowerPC/cr1eq-no-extra-moves.ll

Tobias von Koch tobias.von.koch at gmail.com
Thu Aug 30 07:15:12 PDT 2012


Right. That's the case where there is no chain of register copies before 
the call, so InFlag == 0... Attached is a new revision of the patch 
which should fix this for good.

Thanks Takumi for your testing!

Sorry again,
Tobias


On 30/08/2012 11:59, NAKAMURA Takumi wrote:
> Tobias,
>
> It fixes CodeGen/Generic/2003-07-29-BadConstSbyte.ll.
>
> But it introduces two failures.
>
> Failing Tests (2):
>      LLVM :: CodeGen/Generic/builtin-expect.ll
>      LLVM :: DebugInfo/2009-11-10-CurrentFn.ll
>
> They could be reproduced with llc -mtriple=powerpc-linux on x86_64-linux.
>
> ...Takumi
>
>
>
>
> * Test log in ppc-linux
>
> ******************** TEST 'LLVM :: CodeGen/Generic/builtin-expect.ll'
> FAILED ********************
> Script:
> --
> /home/chapuni/bb/clang-ppc-linux/build/Release+Asserts/bin/llc <
> /home/chapuni/bb/clang-ppc-linux/llvm-project/llvm/test/CodeGen/Generic/builtin-expect.ll
> --
> Exit Code: 139
> Command Output (stderr):
> --
> 0  llc       0x10bc6698
> 1  llc       0x10bc8790
> 2            0x00100364 __kernel_sigtramp32 + 0
> 3            0000000000 __kernel_sigtramp32 + 4293917852
> 4  llc       0x1057b108 llvm::SelectionDAG::getNode(unsigned int,
> llvm::DebugLoc, llvm::SDVTList, llvm::SDValue const*, unsigned int) +
> 1496
> 5  llc       0x1057b5ac llvm::SelectionDAG::getNode(unsigned int,
> llvm::DebugLoc, llvm::SDVTList, llvm::SDValue, llvm::SDValue) + 140
> 6  llc       0x103f0e1c
> llvm::PPCTargetLowering::LowerCall_SVR4(llvm::SDValue, llvm::SDValue,
> llvm::CallingConv::ID, bool, bool,
> llvm::SmallVectorImpl<llvm::ISD::OutputArg> const&,
> llvm::SmallVectorImpl<llvm::SDValue> const&,
> llvm::SmallVectorImpl<llvm::ISD::InputArg> const&, llvm::DebugLoc,
> llvm::SelectionDAG&, llvm::SmallVectorImpl<llvm::SDValue>&) const +
> 4604
> 7  llc       0x103f130c
> llvm::PPCTargetLowering::LowerCall(llvm::TargetLowering::CallLoweringInfo&,
> llvm::SmallVectorImpl<llvm::SDValue>&) const + 460
> 8  llc       0x10594850
> llvm::TargetLowering::LowerCallTo(llvm::TargetLowering::CallLoweringInfo&)
> const + 2800
> 9  llc       0x105a21cc
> llvm::SelectionDAGBuilder::LowerCallTo(llvm::ImmutableCallSite,
> llvm::SDValue, bool, llvm::MachineBasicBlock*) + 2108
> 10 llc       0x105ac5cc
> llvm::SelectionDAGBuilder::visitCall(llvm::CallInst const&) + 220
> 11 llc       0x1059856c llvm::SelectionDAGBuilder::visit(unsigned int,
> llvm::User const&) + 444
> 12 llc       0x105bb6c0
> llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) + 96
> 13 llc       0x105d578c
> llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::Instruction
> const>, llvm::ilist_iterator<llvm::Instruction const>, bool&) + 204
> 14 llc       0x105d621c
> llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) +
> 2460
> 15 llc       0x105d7560
> llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) +
> 1440
> 16 llc       0x103caa90
> 17 llc       0x1076ff78
> llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 248
> 18 llc       0x10b4cf30
> llvm::FPPassManager::runOnFunction(llvm::Function&) + 544
> 19 llc       0x10b4d05c llvm::FPPassManager::runOnModule(llvm::Module&) + 108
> 20 llc       0x10b4ca08 llvm::MPPassManager::runOnModule(llvm::Module&) + 536
> 21 llc       0x10b4cbf0 llvm::PassManagerImpl::run(llvm::Module&) + 224
> 22 llc       0x10b4ccf8 llvm::PassManager::run(llvm::Module&) + 40
> 23 llc       0x100f7990 main + 4432
> 24 libc.so.6 0x0fb750fc
> 25 libc.so.6 0x0fb752a0
> Stack dump:
> 0.      Program arguments:
> /home/chapuni/bb/clang-ppc-linux/build/Release+Asserts/bin/llc
> 1.      Running pass 'Function Pass Manager' on module '<stdin>'.
> 2.      Running pass 'PowerPC DAG->DAG Pattern Instruction Selection'
> on function '@test1'
> /home/chapuni/bb/clang-ppc-linux/build/test/CodeGen/Generic/Output/builtin-expect.ll.script:
> line 1: 13218 Segmentation fault
> /home/chapuni/bb/clang-ppc-linux/build/Release+Asserts/bin/llc <
> /home/chapuni/bb/clang-ppc-linux/llvm-project/llvm/test/CodeGen/Generic/builtin-expect.ll
> --
>
> ********************
> FAIL: LLVM :: DebugInfo/2009-11-10-CurrentFn.ll (3396 of 6414)
> ******************** TEST 'LLVM :: DebugInfo/2009-11-10-CurrentFn.ll'
> FAILED ********************
> Script:
> --
> /home/chapuni/bb/clang-ppc-linux/build/Release+Asserts/bin/llc <
> /home/chapuni/bb/clang-ppc-linux/llvm-project/llvm/test/DebugInfo/2009-11-10-CurrentFn.ll
> -o /dev/null
> --
> Exit Code: 139
> Command Output (stderr):
> --
> 0  llc       0x10bc6698
> 1  llc       0x10bc8790
> 2            0x00100364 __kernel_sigtramp32 + 0
> 3            0x00000002 __kernel_sigtramp32 + 4293917854
> 4  llc       0x1057b108 llvm::SelectionDAG::getNode(unsigned int,
> llvm::DebugLoc, llvm::SDVTList, llvm::SDValue const*, unsigned int) +
> 1496
> 5  llc       0x1057b5ac llvm::SelectionDAG::getNode(unsigned int,
> llvm::DebugLoc, llvm::SDVTList, llvm::SDValue, llvm::SDValue) + 140
> 6  llc       0x103f0e1c
> llvm::PPCTargetLowering::LowerCall_SVR4(llvm::SDValue, llvm::SDValue,
> llvm::CallingConv::ID, bool, bool,
> llvm::SmallVectorImpl<llvm::ISD::OutputArg> const&,
> llvm::SmallVectorImpl<llvm::SDValue> const&,
> llvm::SmallVectorImpl<llvm::ISD::InputArg> const&, llvm::DebugLoc,
> llvm::SelectionDAG&, llvm::SmallVectorImpl<llvm::SDValue>&) const +
> 4604
> 7  llc       0x103f130c
> llvm::PPCTargetLowering::LowerCall(llvm::TargetLowering::CallLoweringInfo&,
> llvm::SmallVectorImpl<llvm::SDValue>&) const + 460
> 8  llc       0x10594850
> llvm::TargetLowering::LowerCallTo(llvm::TargetLowering::CallLoweringInfo&)
> const + 2800
> 9  llc       0x105a21cc
> llvm::SelectionDAGBuilder::LowerCallTo(llvm::ImmutableCallSite,
> llvm::SDValue, bool, llvm::MachineBasicBlock*) + 2108
> 10 llc       0x105ac5cc
> llvm::SelectionDAGBuilder::visitCall(llvm::CallInst const&) + 220
> 11 llc       0x1059856c llvm::SelectionDAGBuilder::visit(unsigned int,
> llvm::User const&) + 444
> 12 llc       0x105bb6c0
> llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) + 96
> 13 llc       0x105d578c
> llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::Instruction
> const>, llvm::ilist_iterator<llvm::Instruction const>, bool&) + 204
> 14 llc       0x105d621c
> llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) +
> 2460
> 15 llc       0x105d7560
> llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) +
> 1440
> 16 llc       0x103caa90
> 17 llc       0x1076ff78
> llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 248
> 18 llc       0x10b4cf30
> llvm::FPPassManager::runOnFunction(llvm::Function&) + 544
> 19 llc       0x10b4d05c llvm::FPPassManager::runOnModule(llvm::Module&) + 108
> 20 llc       0x10b4ca08 llvm::MPPassManager::runOnModule(llvm::Module&) + 536
> 21 llc       0x10b4cbf0 llvm::PassManagerImpl::run(llvm::Module&) + 224
> 22 llc       0x10b4ccf8 llvm::PassManager::run(llvm::Module&) + 40
> 23 llc       0x100f7990 main + 4432
> 24 libc.so.6 0x0fb750fc
> 25 libc.so.6 0x0fb752a0
> Stack dump:
> 0.      Program arguments:
> /home/chapuni/bb/clang-ppc-linux/build/Release+Asserts/bin/llc -o
> /dev/null
> 1.      Running pass 'Function Pass Manager' on module '<stdin>'.
> 2.      Running pass 'PowerPC DAG->DAG Pattern Instruction Selection'
> on function '@bar'
> /home/chapuni/bb/clang-ppc-linux/build/test/DebugInfo/Output/2009-11-10-CurrentFn.ll.script:
> line 1: 21900 Segmentation fault
> /home/chapuni/bb/clang-ppc-linux/build/Release+Asserts/bin/llc -o
> /dev/null < /home/chapuni/bb/clang-ppc-linux/llvm-project/llvm/test/DebugInfo/2009-11-10-CurrentFn.ll
> --
>
> ********************
> Testing Time: 428.44s
> ********************
> Failing Tests (2):
>      LLVM :: CodeGen/Generic/builtin-expect.ll
>      LLVM :: DebugInfo/2009-11-10-CurrentFn.ll
>
>
>
>
> * Test log in x86_64-linux with -mtriple=powerpc-linux
>
> FAIL: LLVM :: CodeGen/Generic/builtin-expect.ll (1042 of 6406)
> ******************** TEST 'LLVM :: CodeGen/Generic/builtin-expect.ll'
> FAILED ********************
> Script:
> --
> /home/chapuni/BUILD/cmake-static/Release/bin/./llc
> -mtriple=powerpc-linux <
> /home/chapuni/llvm-project/llvm/test/CodeGen/Generic/builtin-expect.ll
> --
> Exit Code: 139
> Command Output (stderr):
> --
> Stack dump:
> 0.      Program arguments:
> /home/chapuni/BUILD/cmake-static/Release/bin/./llc
> -mtriple=powerpc-linux
> 1.      Running pass 'Function Pass Manager' on module '<stdin>'.
> 2.      Running pass 'PowerPC DAG->DAG Pattern Instruction Selection'
> on function '@test1'
> /home/chapuni/BUILD/cmake-static/Release/test/CodeGen/Generic/Output/builtin-expect.ll.script:
> line 1: 12244 Segmentation fault
> /home/chapuni/BUILD/cmake-static/Release/bin/./llc
> -mtriple=powerpc-linux <
> /home/chapuni/llvm-project/llvm/test/CodeGen/Generic/builtin-expect.ll
> --
>
> ********************
> FAIL: LLVM :: DebugInfo/2009-11-10-CurrentFn.ll (3393 of 6406)
> ******************** TEST 'LLVM :: DebugInfo/2009-11-10-CurrentFn.ll'
> FAILED ********************
> Script:
> --
> /home/chapuni/BUILD/cmake-static/Release/bin/./llc
> -mtriple=powerpc-linux<
> /home/chapuni/llvm-project/llvm/test/DebugInfo/2009-11-10-CurrentFn.ll
> -o /dev/null
> --
> Exit Code: 139
> Command Output (stderr):
> --
> Stack dump:
> 0.      Program arguments:
> /home/chapuni/BUILD/cmake-static/Release/bin/./llc
> -mtriple=powerpc-linux -o /dev/null
> 1.      Running pass 'Function Pass Manager' on module '<stdin>'.
> 2.      Running pass 'PowerPC DAG->DAG Pattern Instruction Selection'
> on function '@bar'
> /home/chapuni/BUILD/cmake-static/Release/test/DebugInfo/Output/2009-11-10-CurrentFn.ll.script:
> line 1: 20918 Segmentation fault
> /home/chapuni/BUILD/cmake-static/Release/bin/./llc
> -mtriple=powerpc-linux -o /dev/null <
> /home/chapuni/llvm-project/llvm/test/DebugInfo/2009-11-10-CurrentFn.ll
> --
>
> ********************
>
>
>
> 2012/8/30 Tobias von Koch <tobias.von.koch at gmail.com>:
>> Hal,
>>
>> Whoops sorry can't believe I never hit that bug. Fix is attached.
>>
>> What's happening here is that the CR6SET/CR6UNSET is breaking the chain of
>> register copies glued to the function call (BL_SVR4 node). The scheduler
>> then moves other instructions in between those and the function call, which
>> isn't good!
>>
>> Tobias
>>
>>
>> On 29/08/2012 18:36, Hal Finkel wrote:
>>>
>>> Tobias,
>>>
>>> Will you be able to fix this soon, or should I revert while you work on
>>> it?
>>>
>>>    -Hal
>>>
>>> On Wed, 29 Aug 2012 20:29:44 +0900
>>> NAKAMURA Takumi <geek4civic at gmail.com> wrote:
>>>
>>>> Hal and Tobias,
>>>>
>>>> It has triggered one failure on ppc-linux (ps3, f12).
>>>>
>>>> Failing Tests (1):
>>>>       LLVM :: CodeGen/Generic/2003-07-29-BadConstSbyte.ll
>>>>
>>>> http://bb.pgr.jp/builders/clang-ppc-linux
>>>>
>>>> I won't reproduce to add triple to the test on x86_64-linux host.
>>>>
>>>> ...Takumi
>>>>
>>

-------------- next part --------------
diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp
index ac87e76..afef4a6 100644
--- a/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -3164,8 +3164,12 @@ PPCTargetLowering::LowerCall_SVR4(SDValue Chain, SDValue Callee,
   // Set CR bit 6 to true if this is a vararg call with floating args passed in
   // registers.
   if (isVarArg) {
+    SDVTList VTs = DAG.getVTList(MVT::Other, MVT::Glue);
+    SDValue Ops[] = { Chain, InFlag };
+
     Chain = DAG.getNode(seenFloatArg ? PPCISD::CR6SET : PPCISD::CR6UNSET,
-                        dl, DAG.getVTList(MVT::Other, MVT::Glue), Chain);
+                        dl, VTs, Ops, InFlag.getNode() ? 2 : 1);
+						
     InFlag = Chain.getValue(1);
   }
 


More information about the llvm-commits mailing list