
Set the writable and dead_on_unwind attributes for sret arguments. These indicate that the argument points to writable memory (and it's legal to introduce spurious writes to it on entry to the function) and that the argument memory will not be used if the call unwinds. This enables additional MemCpyOpt/DSE/LICM optimizations.
18 lines
297 B
C++
18 lines
297 B
C++
// RUN: %clang_cc1 -triple mips64el-unknown-linux -O3 -target-abi n64 -o - -emit-llvm %s | FileCheck %s
|
|
|
|
class B {
|
|
public:
|
|
virtual ~B() {}
|
|
};
|
|
|
|
class D : public B {
|
|
};
|
|
|
|
extern D gd0;
|
|
|
|
// CHECK: _Z4foo1v(ptr dead_on_unwind noalias nocapture writable writeonly sret
|
|
|
|
D foo1(void) {
|
|
return gd0;
|
|
}
|