mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-09 05:31:37 +00:00
have dag combine zap "store undef", which can be formed during call lowering
with undef arguments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129185 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4ae6a4d696
commit
b3452ea35c
@ -6264,6 +6264,10 @@ SDValue DAGCombiner::visitSTORE(SDNode *N) {
|
|||||||
Ptr, ST->getPointerInfo(), ST->isVolatile(),
|
Ptr, ST->getPointerInfo(), ST->isVolatile(),
|
||||||
ST->isNonTemporal(), OrigAlign);
|
ST->isNonTemporal(), OrigAlign);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Turn 'store undef, Ptr' -> nothing.
|
||||||
|
if (Value.getOpcode() == ISD::UNDEF && ST->isUnindexed())
|
||||||
|
return Chain;
|
||||||
|
|
||||||
// Turn 'store float 1.0, Ptr' -> 'store int 0x12345678, Ptr'
|
// Turn 'store float 1.0, Ptr' -> 'store int 0x12345678, Ptr'
|
||||||
if (ConstantFPSDNode *CFP = dyn_cast<ConstantFPSDNode>(Value)) {
|
if (ConstantFPSDNode *CFP = dyn_cast<ConstantFPSDNode>(Value)) {
|
||||||
@ -6298,8 +6302,10 @@ SDValue DAGCombiner::visitSTORE(SDNode *N) {
|
|||||||
return DAG.getStore(Chain, N->getDebugLoc(), Tmp,
|
return DAG.getStore(Chain, N->getDebugLoc(), Tmp,
|
||||||
Ptr, ST->getPointerInfo(), ST->isVolatile(),
|
Ptr, ST->getPointerInfo(), ST->isVolatile(),
|
||||||
ST->isNonTemporal(), ST->getAlignment());
|
ST->isNonTemporal(), ST->getAlignment());
|
||||||
} else if (!ST->isVolatile() &&
|
}
|
||||||
TLI.isOperationLegalOrCustom(ISD::STORE, MVT::i32)) {
|
|
||||||
|
if (!ST->isVolatile() &&
|
||||||
|
TLI.isOperationLegalOrCustom(ISD::STORE, MVT::i32)) {
|
||||||
// Many FP stores are not made apparent until after legalize, e.g. for
|
// Many FP stores are not made apparent until after legalize, e.g. for
|
||||||
// argument passing. Since this is so common, custom legalize the
|
// argument passing. Since this is so common, custom legalize the
|
||||||
// 64-bit integer store into two 32-bit stores.
|
// 64-bit integer store into two 32-bit stores.
|
||||||
|
@ -27,3 +27,18 @@ UnifiedReturnBlock: ; preds = %entry
|
|||||||
}
|
}
|
||||||
|
|
||||||
declare i32 @f(%struct.decode_t*)
|
declare i32 @f(%struct.decode_t*)
|
||||||
|
|
||||||
|
|
||||||
|
; There should be no store for the undef operand.
|
||||||
|
|
||||||
|
; CHECK: _test2:
|
||||||
|
; CHECK-NOT: 8(%esp)
|
||||||
|
; CHECK: 4(%esp)
|
||||||
|
; CHECK: calll
|
||||||
|
declare i32 @foo(i32, i32, i32)
|
||||||
|
|
||||||
|
define void @test2() nounwind {
|
||||||
|
entry:
|
||||||
|
%call = call i32 @foo(i32 8, i32 6, i32 undef)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user